Node.js 当我尝试安装盖茨比时,如何解决此错误消息?

Node.js 当我尝试安装盖茨比时,如何解决此错误消息?,node.js,gatsby,Node.js,Gatsby,用sudo这样做: sudo npm i-g gatsby cli您是否有权限读取和写入usr/local/lib/node_模块?是!多亏了Naor关于在终端中使用sudo npm i-g gatsby cli的建议,这个问题才得以解决。你们太棒了!!我花了2个小时在我的终端上尝试了不同的东西,终于成功了!非常感谢你Naor! adamlantz@student-212-160 ~ % npm i -g gatsby-cli npm WARN deprecated core-js@2.6.11

用sudo这样做:


sudo npm i-g gatsby cli

您是否有权限读取和写入usr/local/lib/node_模块?是!多亏了Naor关于在终端中使用sudo npm i-g gatsby cli的建议,这个问题才得以解决。你们太棒了!!我花了2个小时在我的终端上尝试了不同的东西,终于成功了!非常感谢你Naor!
adamlantz@student-212-160 ~ % npm i -g gatsby-cli
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
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! 
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/adamlantz/.npm/_logs/2020-03-16T10_26_37_976Z-debug.log