javascript - npm 错误!该操作被您的操作系统拒绝

标签 javascript reactjs ubuntu

这个问题在这里已经有了答案:





npm install -g less does not work: EACCES: permission denied

(14 个回答)


2年前关闭。



npm install -g create-react-app
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/legend/.npm/_logs/2020-05-04T08_45_14_806Z-debug.log

最佳答案

您需要管理员权限才能全局安装模块,使用 sudo 运行命令:

sudo npm install -g create-react-app

关于javascript - npm 错误!该操作被您的操作系统拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61588414/

相关文章:

python - 导入错误 Python 2.7。没有名为 : 的模块

javascript - 为什么这个 .js 脚本停止工作并导致浏览器卡住?

javascript - 未捕获的范围错误 : Maximum call stack size exceeded

javascript - 使 CSS 菜单项和标题扩展到正确的宽度

reactjs - 如何编写测试用例以通过 mocha nyc for API 传递代码覆盖率?

python - Ubuntu : Unable to correct problems, 你有损坏的包

postgresql - 页面管理员。无法在下拉列表中输入

javascript - x-lite 或 Bria 软电话的 websocket javascript 请求

javascript - 针对特定子组件的 React propTypes

reactjs - 从命令行运行 jest 时出现 "No tests found"