我有一个新安装的Mac OS Catalina,它不允许我安装npm应用程序。我尝试了sudo和non sudo。
npm install --global browser-sync但是得到了这个错误,
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/browser-sync
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/browser-sync
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/browser-sync'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/browser-sync'] {
npm ERR! stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules/browser-sync'",
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/browser-sync'
npm ERR! }
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! /Users/nicholasdixon/.npm/_logs/2019-12-14T07_09_23_421Z-debug.log发布于 2020-01-03 16:33:16
这是重新安装操作系统时出现的UNIX问题。
您可以通过在终端中键入以下命令来修复它:
sudo chown -R $USER /usr/local/lib/node_modules这对我很有效,希望对你也一样。
https://stackoverflow.com/questions/59333094
复制相似问题