【发布时间】:2018-11-29 12:47:43
【问题描述】:
Angular 安装失败并出现以下错误,并且未安装 Angular。
D:\software\node-v8.11.2-win-x64>npm install -g @angular/cli D:\软件\node-v8.11.2-win-x64\ng -> D:\eclipse\software\node-v8.11.2-win-x64\node_modules@angular\cli\bin\ng
@angular/cli@6.0.8 安装后 D:\eclipse\software\node-v8.11.2-win-x64\node_modules@angular\cli 节点 ./bin/ng-update-message.js
'node' 不是内部或外部命令,可操作 程序或批处理文件。 npm WARN 可选跳过可选依赖: fsevents@1.2.4 (node_modules@angular\cli\node_modules\fsevents): npm 警告 notsup 跳过可选依赖:不支持的平台 fsevents@1.2.4: 想要 {"os":"darwin","arch":"any"}(当前: {"os":"win32","arch":"x64"})
npm 错误!代码 ELIFECYCLE npm 错误! errno 1 npm 错误! @angular/cli@6.0.8 安装后:节点 ./bin/ng-update-message.js npm ERR!退出状态 1 npm 错误! npm 错误! @angular/cli@6.0.8 安装后脚本失败。 npm 错误!这可能不是 npm 的问题。有可能 上面的附加日志输出。
npm 错误!可以在以下位置找到此运行的完整日志:npm ERR! C:\Users\N96304.LAUNCHER\AppData\Roaming\npm-cache_logs\2018-06-19T08_39_53_490Z-debug.lo
日志错误:
8474 info lifecycle @angular/cli@6.0.8~postinstall: @angular/cli@6.0.8
8475 verbose lifecycle @angular/cli@6.0.8~postinstall: unsafe-perm in lifecycle true
8476 verbose lifecycle @angular/cli@6.0.8~postinstall: PATH: D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;D:software\node-v8.11.2-win-x64\node_modules\@angular\cli\node_modules\.bin;D:software\node-v8.11.2-win-x64\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Microsoft Application Virtualization Client;C:\Program Files (x86)\EHLLAPI\;C:\Program Files (x86)\PortalClient\;C:\Program Files (x86)\Citrix\ICAService;C:\Program Files (x86)\Citrix\System32;C:\Program Files (x86)\InstallShield\AdminStudio\6.0\ConflictSolver;C:\Program Files (x86)\Common Files\Citrix\system32;C:\Program Files\Citrix\System32\;C:\Program Files\Citrix\ICAService\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\instantclient_12_2;C:\Program Files\instantclient_12_2;D:software\New folder\Fiddler;D:software\Fiddler
8477 verbose lifecycle @angular/cli@6.0.8~postinstall: CWD: D:software\node-v8.11.2-win-x64\node_modules\@angular\cli
8478 silly lifecycle @angular/cli@6.0.8~postinstall: Args: [ '/d /s /c', 'node ./bin/ng-update-message.js' ]
8479 silly lifecycle @angular/cli@6.0.8~postinstall: Returned: code: 1 signal: null
8480 info lifecycle @angular/cli@6.0.8~postinstall: Failed to exec postinstall script
8481 verbose unlock done using C:\Users\N96304.LAUNCHER\AppData\Roaming\npm-cache\_locks\staging-acb702ed8f4300ec.lock for D:software\node-v8.11.2-win-x64\node_modules\.staging
8482 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\@angular\cli\node_modules\fsevents):
8483 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
8484 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
8485 verbose stack Error: @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
8485 verbose stack Exit status 1
8485 verbose stack at EventEmitter.<anonymous> (D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
8485 verbose stack at emitTwo (events.js:126:13)
8485 verbose stack at EventEmitter.emit (events.js:214:7)
8485 verbose stack at ChildProcess.<anonymous> (D:software\node-v8.11.2-win-x64\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
8485 verbose stack at emitTwo (events.js:126:13)
8485 verbose stack at ChildProcess.emit (events.js:214:7)
8485 verbose stack at maybeClose (internal/child_process.js:925:16)
8485 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
8486 verbose pkgid @angular/cli@6.0.8
8487 verbose cwd D:software\node-v8.11.2-win-x64
8488 verbose Windows_NT 6.1.7601
8489 verbose argv "D:\\software\\node-v8.11.2-win-x64\\node.exe" "D:\\software\\node-v8.11.2-win-x64\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "@angular/cli"
8490 verbose node v8.11.2
8491 verbose npm v5.6.0
8492 error code ELIFECYCLE
8493 error errno 1
8494 error @angular/cli@6.0.8 postinstall: `node ./bin/ng-update-message.js`
8494 error Exit status 1
8495 error Failed at the @angular/cli@6.0.8 postinstall script.
8495 error This is probably not a problem with npm. There is likely additional logging output above.
8496 verbose exit [ 1, true ]
【问题讨论】:
-
需要安装节点
-
检查路径中是否有
node。打开 Cmd 并写入node。 -
尝试
npm cache clean --force然后npm install -g @angular/cli -
您是否以管理员身份运行?
标签: angular npm angular-cli