当我在 RN 项目上运行时react-native link,出现以下错误:
$ react-native link
rnpm-install ERR! ERRPACKAGEJSON No package found. Are you sure it's a React Native project?
Cannot read property '_text' of undefined
Run Code Online (Sandbox Code Playgroud)
我查了一下,有人说运行react-native upgrade可以解决这个问题。我试过了,但是没有锁。我的react版本如下所示:
$ react-native --version
react-native-cli: 2.0.1
react-native: 0.39.2
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
按顺序执行以下步骤 -
npm cache clean或者yarn cache cleanrm -rf node_modulesyarn install或者npm installreact-native upgrade(所有步骤都可以选择否)react-native link如果您收到与权限相关的错误,请使用sudo所有命令。
| 归档时间: |
|
| 查看次数: |
7300 次 |
| 最近记录: |