node.js - npm启动时react-native报错

标签 node.js react-native npm

我正在使用 Node - v10.6.0 npm版本-4.6.1

当我尝试在项目文件夹下执行命令 npm start 时,出现错误

[email protected]启动/mnt/E/react_native/my_app

react-native-scripts start

sh: 1: react-native-scripts: Permission denied npm ERR! code ELIFECYCLE npm ERR! errno 126 npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d1bca88eb0a1a191e1ffe0ffe1" rel="noreferrer noopener nofollow">[email protected]</a> start: react native 脚本启动 npm ERR! Exit status 126 npm ERR! npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="0e6377516f7e7e4e3e203f203e" rel="noreferrer noopener nofollow">[email protected]</a> start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

请帮助解决问题

最佳答案

我认为您正在 MAC 上运行代码。如果是,请尝试运行以下命令:

sudo chown -R username:groupname directory

其中“username”是您当前的用户名,“groupname”是您的主要组,“directory”是您的项目目录路径。
然后删除node_modules文件夹并尝试以下命令:

npm install
npm start

关于node.js - npm启动时react-native报错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51262854/

相关文章:

node.js - 在 nodejs 中跟踪哪些用户在线的最佳方法是什么?

reactjs - 执行 createUserWithEmailAndPassword 后,React Native 使用 sendEmailVerification 检查用户电子邮件

react-native - Net-info 发生错误在 React-Native 中不起作用

node.js - 运行 npm install 取消构建全局 npm

node.js - npm-cache 目录下,_cacache 以外的文件夹是做什么用的?

node.js - 尝试在嵌入字段上确保索引时出错(键名不能包含 ".")

node.js - Express.js session 在服务器重新启动时重置

ios - FlatList 使用 Redux 重新渲染

angular - ngx-datatable ERESOLVE 无法解析依赖树

javascript - Reveal.js 多路复用不起作用