Ubuntu安装angular失败,一直卡在uglifyjs-webpack-plugin@0.4.6

0 0 html ubuntu javascript angular4
ニセモノ
ニセモノ

声望值:75 0人

2018-12-28 09:57:25 提问

关注 0关注

收藏 0收藏, 209浏览

图片描述

root@xiangdong-virtual-machine:/home/xiangdong# sudo npm i -g @angular/cli
/root/tools/node-v8.9.3-linux-x64/bin/ng -> /root/tools/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/bin/ng

node-sass@4.7.2 install /root/tools/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/node_modules/node-sass
node scripts/install.js

sh: 1: node: Permission denied

uglifyjs-webpack-plugin@0.4.6 postinstall /root/tools/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/node_modules/webpack/node_modules/uglifyjs-webpack-plugin
node lib/post_install.js

sh: 1: node: Permission denied
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules/@angular/cli/node_modules/node-sass):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 install: node scripts/install.js
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn ENOENT

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: node lib/post_install.js
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2017-12-20T10_31_29_596Z-debug.log
求大神解答疑惑!

请先 登录 后评论

2个回答

  • aゞ特仑苏97声望 2018-10-15 15:54

    sudo 权限不够~~~ 有些文件夹是只有system才能进行读写~~ 可以尝试下在自己的文件夹"home/:username"跑 npm install angular@cli;之后使用ln 链接到/usr/bin;应该就可以全局运行了
    请先 登录 后评论
  • wy小骑士55声望 2018-10-15 15:54

    之前 CentOS 上安装 webpack 时也出现了这个错误。最后用 yarn 代替 npm 解决了。https://yarnpkg.com/en/docs/install#linux-tab你可以尝试一下。
    请先 登录 后评论

注册新账号

悬赏追问
10
  • 10
  • 20
  • 50
  • 100
  • 200
  • 输入数值
发布追问