角CLI安装在窗口7错误(Angular-cli install in window 7 Error

2019-09-29 04:45发布

绑在Windows 7安装角CLI,但是给下面的错误; 请帮助需要为同做什么。

    C:\Users\admin>npm i -g @angular/cli
C:\Users\admin\AppData\Roaming\npm\ng -> C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli\bin\ng

> @angular/cli@6.0.8 postinstall C:\Users\admin\AppData\Roaming\npm\node_modules\@angular\cli
> node ./bin/ng-update-message.js

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":"win32","arch":"x64"})

npm ERR! file C:\Windows\system32\cmd.exe;C:\Windows\System32\cmd.exe
npm ERR! path C:\Windows\system32\cmd.exe;C:\Windows\System32\cmd.exe
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn C:\Windows\system32\cmd.exe;C:\Windows\System32\cmd.exe
npm ERR! @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
npm ERR! spawn C:\Windows\system32\cmd.exe;C:\Windows\System32\cmd.exe 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!     C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-07-23T06_21_58_799Z-debug.log

节点版本:

v8.11.3

NPM版本:

6.2.0

Answer 1:

尝试用这个命令

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


Answer 2:

您可以流这些步骤安装角度CLI

  1. 安装节点v8.xx
  2. NPM安装Windows的构建工具-g
  3. NPM安装@角的devkit /芯-g
  4. NPM安装@角/ CLI -g

快乐编码



文章来源: Angular-cli install in window 7 Error