【发布时间】:2018-06-08 16:31:31
【问题描述】:
我是第一次安装 Angular。我正在使用 Windows 7。 node -v is v8.10.0 和 npm -v is 5.7.1 当我运行命令安装 angular cli 时。
npm install -g @angular/cli
我收到此错误。导致此错误的原因以及如何在 Windows 上安装 Angular。我不熟悉 npm 和 angular
\Users\username>npm install -g @angular/cli
\Users\username\ng -> C:\Users\username\node_modules\@angular\cli\bin\ng
node-sass@4.7.2 install C:\Users\username\node_modules\@angular\cli\node_modules\node-sass
node scripts/install.js
uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\username\node_modules\@angular\cli\node_modules\webpack\node_modules\uglifyjs-webpack-plugin
node lib/post_install.js
m WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\@angular\cli\node_modules\fsevents):
m WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
m WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 (node_modules\@angular\cli\node_modules\node-sass):
m WARN optional SKIPPING OPTIONAL DEPENDENCY: node-sass@4.7.2 install: `node scripts/install.js`
m WARN optional SKIPPING OPTIONAL DEPENDENCY: spawn bash ENOENT
m ERR! file bash
m ERR! path bash
m ERR! code ELIFECYCLE
m ERR! errno ENOENT
m ERR! syscall spawn bash
m ERR! uglifyjs-webpack-plugin@0.4.6 postinstall: `node lib/post_install.js`
m ERR! spawn bash ENOENT
m ERR!
m ERR! Failed at the uglifyjs-webpack-plugin@0.4.6 postinstall script.
m ERR! This is probably not a problem with npm. There is likely additional logging output above.
m ERR! A complete log of this run can be found in:
m ERR! C:\Users\username\AppData\Roaming\npm-cache\_logs\2018-03-09T15_29_18_155Z-debug.log
【问题讨论】:
-
您是否使用管理员权限运行此安装?如果没有,请在管理员命令提示符或 PowerShell 中尝试安装。
-
我尝试使用管理员命令提示符但同样的错误
标签: angular npm angular-cli