reactjs - 错误 : React native is not installed. 请在您的项目目录中运行 `npm install`

标签 reactjs react-native react-redux

只是按照 facebook.github 上的说明创建-react-native-app 首先得到:react-redux 5.0.6 requires a peer of react@^0.14.0 || react @^15.0.0-0 .... 然后我卸载了 react-redux 现在得到这个......

here is package.json

启动打包器时出错

错误:未安装 React Native。请在您的项目目录中运行 npm install。 上午 1:23:51:启动打包程序时出错:错误:无法启动项目。请修复 他出错并重新启动项目。 在 E:\xdl\src\Project.js:1126:11 接下来(本地) 在步骤 (E:\react-native\hello-world\node_modules\xdl\build\Project.js:1504: 191) 在 E:\react-native\hello-world\node_modules\xdl\build\Project.js:1504:361 错误!代码生命周期 错误!错误号 1 错误! hello-world@0.1.0 开始:react-native-scripts 开始 错误!退出状态 1 错误! 错误! hello-world@0.1.0 启动脚本失败。 错误!这可能不是 npm 的问题。可能有额外的日志 上面的ging输出。

npm 错误!可以在以下位置找到此运行的完整日志: 错误! C:\Users\Jawad Ul Hassan\AppData\Roaming\npm-cache_logs\2017-09-08 T20_23_51_654Z-debug.log

可能是我的错误或关于正确操作的任何建议?

在 npm install 之后

npm WARN addRemoteGit Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\Jawad Ul Hassan\AppData\
Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit at E (C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\nod
e_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15)
npm WARN addRemoteGit  expo/node-websql#18.0.0 resetting remote C:\Users\Jawad U
l Hassan\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-websql-
git-18-0-0-8213877d because of error: { Error: not found: git
npm WARN addRemoteGit     at getNotFoundError (C:\Users\Jawad Ul Hassan\AppData\
Roaming\npm\node_modules\npm\node_modules\which\which.js:13:12)
npm WARN addRemoteGit     at F (C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\nod
e_modules\npm\node_modules\which\which.js:68:19)
npm WARN addRemoteGit     at E (C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\nod
e_modules\npm\node_modules\which\which.js:80:29)
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\which.js:89:16
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\node_modules\isexe\index.js:42:5
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\which\node_modules\isexe\windows.js:36:5
npm WARN addRemoteGit     at C:\Users\Jawad Ul Hassan\AppData\Roaming\npm\node_m
odules\npm\node_modules\graceful-fs\polyfills.js:284:29
npm WARN addRemoteGit     at FSReqWrap.oncomplete (fs.js:123:15) code: 'ENOGIT'
}
npm ERR! git clone --template=C:\Users\Jawad Ul Hassan\AppData\Roaming\npm-cache
\_git-remotes\_templates --mirror git@github.com:expo/node-websql.git C:\Users\J
awad Ul Hassan\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-w
ebsql-git-18-0-0-8213877d: undefined
npm ERR! git clone --template=C:\Users\Jawad Ul Hassan\AppData\Roaming\npm-cache
\_git-remotes\_templates --mirror git@github.com:expo/node-websql.git C:\Users\J
awad Ul Hassan\AppData\Roaming\npm-cache\_git-remotes\git-github-com-expo-node-w
ebsql-git-18-0-0-8213877d: undefined

最佳答案

当我安装 react-navigation 包时,我发生了错误。我已经解决了我的问题

  1. 删除node_modules、package-lock.json
  2. 运行“yarn 安装”。
  3. 运行“npm start”。

关于reactjs - 错误 : React native is not installed. 请在您的项目目录中运行 `npm install`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46124250/

相关文章:

javascript - 当我们到达列表底部时,React Native FlatList 加载更多

javascript - 在react项目中映射APi

javascript - JS promise 未按预期解决

javascript - redux-thunk:暂停组件执行直到 Action Creator 完成

datepicker - Material UI 日期选择器 日期格式 React

reactjs - React - 尝试更改 <img> src 属性

javascript - WebStorm 会自动下载 JavaScript 类型。如何阻止这种情况?

reactjs - 通过单击相同的链接来重新加载页面

javascript - 使用 SVG 导入对样式化组件进行单元测试

javascript - react native : Is there any way to check if the file exists in android_asset folder or not?