在Mac OS的终端中安装nodeJS的parcel模块时,我遇到了权限错误。
错误:checkPermission缺少对/usr/local/lib/node_modules的写访问权限。
我刚开始学习Node模块,尝试安装(Node,NPM),一切都正常。但是第一次安装节点模块时会抛出错误。我知道它正在寻找类似Windows类型URL的目录,但我不知道如何为Mac解决此问题。
我刚开始学习Node模块,尝试安装(Node,NPM),一切都正常。但是第一次安装节点模块时会抛出错误。我知道它正在寻找类似Windows类型URL的目录,但我不知道如何为Mac解决此问题。
iMac:~ hassan$ node -v
v11.10.0
iMac:~ hassan$ npm -v
6.7.0
iMac:~ hassan$ npm install -g parcel-bundler
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
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:
npm ERR! "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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/hassan/.npm/_logs/2019-04-23T13_13_46_848Z-debug.log
我想在我的网站上安装Parcel打包程序,用于UI动画。
sudo npm install -g parcel-bundler
。 - Chris Whitesudo chown -R $USER /usr/lib/node_modules
sudo chown -R $USER /usr/local/lib/node_modules(附注:抱歉没有换行符,显然Markdown在这里不起作用?) - tronster