我正在使用 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/