我试图在我的Ubuntu 16.04系统上安装Angular,但出现错误。
我尝试通过以下方式安装。
版本:
myuser@mylaptop:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.4 LTS
Release: 16.04
Codename: xenial
myuser@mylaptop:~$ node -v
v8.11.3
myuser@mylaptop:~$ npm -v
6.2.0
安装:
myuser@mylaptop:~$ sudo npm install -g @angular/cli
[sudo] Passwort für myuser:
/home/myuser/.npm-packages/bin/ng -> /home/myuser/.npm-packages/lib/node_modules/@angular/cli/bin/ng
> @angular/cli@6.0.8 postinstall /home/myuser/.npm-packages/lib/node_modules/@angular/cli
> node ./bin/ng-update-message.js
module.js:549
throw err;
^
Error: Cannot find module '/home/myuser/.npm-packages/lib/node_modules/@angular/cli/bin/ng-update-message.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Function.Module.runMain (module.js:693:10)
at startup (bootstrap_node.js:191:16)
at bootstrap_node.js:612:3
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @angular/cli@6.0.8 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! /home/myuser/.npm/_logs/2018-07-16T11_16_20_509Z-debug.log
有人遇到同样的问题吗?知道如何解决吗?