npm install -g @ angular / cli命令不安装angular cli

时间:2018-02-20 10:09:41

标签: node.js angular npm angular-cli

我正在创建一个示例angular2 web应用程序。为此,我安装了node.js(v 7.1.0)和NPM(v 3.10.9)。 现在在执行命令后打开系统命令提示符: NPM安装-g @ angular / cli 安装角度cli我得到以下显示的结果。 在执行ng -v检查已安装的cli版本后,我没有得到版本号。

cli安装不正确吗? 或者我是否需要在环境变量中设置任何路径变量? 这里有什么要做的?请指教。

C:\Users\27727>d:

D:\>cd learn-angular

D:\learn-angular>npm i -g @angular/cli
npm WARN gentlyRm not removing C:\Users\27727\AppData\Roaming\npm\ng.cmd as it w
asn't installed by C:\Users\27727\AppData\Roaming\npm\node_modules\@angular\cli
npm WARN gentlyRm not removing C:\Users\27727\AppData\Roaming\npm\ng as it wasn'
t installed by C:\Users\27727\AppData\Roaming\npm\node_modules\@angular\cli
C:\Users\27727\AppData\Roaming\npm\ng -> C:\Users\27727\AppData\Roaming\npm\node
_modules\@angular\cli\bin\ng
C:\Users\27727\AppData\Roaming\npm
`-- @angular/cli@1.7.0

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@a
ngular\cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\@a
ngular\cli\node_modules\webpack-dev-server\node_modules\chokidar\node_modules\fs
events):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@
1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}
)
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none was installed
.

D:\learn-angular>ng -v
'ng' is not recognized as an internal or external command,
operable program or batch file.

D:\learn-angular>

1 个答案:

答案 0 :(得分:0)

在您的系统中,请检查此路径(C:\Program Files\nodejs)是否存在于环境变量中。