0
我要在我的Ubuntu 16.04計算機上安裝@ angular/cli。我的節點版本是 V7.10.0和NPM是5.0.0嘗試安裝@ angular/cli時獲取權限錯誤
我不斷收到此錯誤:
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@angular/cli/node_modules/node-sass/build'
gyp ERR! System Linux 4.10.0-21-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/@angular/cli/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/@angular/cli/node_modules/node-sass
gyp ERR! node -v v7.10.0
gyp ERR! node-gyp -v v3.6.1
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/cli/node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] postinstall: `node scripts/build.js`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
我也嘗試下面的命令:
npm cache clean --force
sudo npm install -g @angular/cli
我應該嘗試手動和更改權限或所有權使用chmod或chown?
您是否使用sudo拒絕了權限? –
https://docs.npmjs.com/getting-started/fixing-npm-permissions –
@ alex-rokabilis是的 –