Erron在Mac上安装Angle

时间:2018-07-08 01:35:56

标签: node.js angular macos macos-high-sierra

我尝试使用以下命令在Mac上安装Angular CLI

  

sudo npm install -g @ angular / cli

错误显示如下

/usr/local/bin/ng -> /usr/local/lib/node_modules/@angular/cli/bin/ng

> fsevents@1.2.4 install /usr/local/lib/node_modules/@angular/cli/node_modules/fsevents
> node install

sh: node: command not found

> @angular/cli@6.0.8 postinstall /usr/local/lib/node_modules/@angular/cli
> node ./bin/ng-update-message.js

sh: node: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 install: `node install`
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! @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
npm ERR! spawn ENOENT
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!     /Users/sugunan/.npm/_logs/2018-07-08T01_27_53_465Z-debug.log

如何解决此问题?

1 个答案:

答案 0 :(得分:1)

以下命令有效

  

sudo npm install -g @ angular / cli --unsafe-perm = true --allow-root