安装带有Angular 6项目的网页包时出错

安装带有Angular 6项目的网页包时出错,angular,webpack,angular-webpack,angular-webpack-starter,Angular,Webpack,Angular Webpack,Angular Webpack Starter,安装带有Angular6项目的网页包时 我遇到错误,无法安装它 我使用CLI命令进入名为myNewAngularPro的项目文件夹 users-MacBook-Pro-3:myNewAngularPro user$ npm install -g webpack-cli 我收到的错误-: npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules npm WARN webpack-cli@3.1.0

安装带有Angular6项目的网页包时 我遇到错误,无法安装它
我使用CLI命令进入名为myNewAngularPro的项目文件夹

users-MacBook-Pro-3:myNewAngularPro user$ npm install -g webpack-cli
我收到的错误-:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN webpack-cli@3.1.0 requires a peer of webpack@^4.x.x but none is installed. You must install peer dependencies yourself.

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: '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/user/.npm/_logs/2018-09-04T10_34_48_494Z-debug.log

你是以管理员的身份运行吗?是的,我是以管理员的身份运行。为什么你要单独安装你的应用程序中已有的网页?如果要更新,请先更新应用程序,然后再更新网页,或者------只需使用------npm I webpack向你展示json包