Angular-cli: can not install angular cli

Created on 10 Mar 2017  路  9Comments  路  Source: angular/angular-cli

can not install angular cli by cmd npm install -g @angular/cli

OS

CentOS release 6.5 (Final) (Linux 2.6.32-573.22.1.el6.x86_64)

Versions.

$ node -v
$ v6.10.0
$ npm -v
$ 3.10.10
$ tsc -v
$ Version 2.2.1

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

84621 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/@angular/cli/node_modules/chokidar/node_modules/fsevents):
84622 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
84623 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
84623 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
84623 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: linux
84623 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
84624 verbose stack Error: [email protected] postinstall: node scripts/build.js
84624 verbose stack Exit status 1
84624 verbose stack at EventEmitter. (/home/eco/lib/node-v6.10.0-linux-x64/lib/node_modules/npm/lib/utils/lifecycle.js:255:16)
84624 verbose stack at emitTwo (events.js:106:13)
84624 verbose stack at EventEmitter.emit (events.js:191:7)
84624 verbose stack at ChildProcess. (/home/eco/lib/node-v6.10.0-linux-x64/lib/node_modules/npm/lib/utils/spawn.js:40:14)
84624 verbose stack at emitTwo (events.js:106:13)
84624 verbose stack at ChildProcess.emit (events.js:191:7)
84624 verbose stack at maybeClose (internal/child_process.js:877:16)
84624 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
84625 verbose pkgid [email protected]
84626 verbose cwd /home/eco
84627 error Linux 2.6.32-573.22.1.el6.x86_64
84628 error argv "/home/eco/lib/node-v6.10.0-linux-x64/bin/node" "/home/eco/lib/node-v6.10.0-linux-x64/bin/npm" "install" "-g" "@angular/cli"
84629 error node v6.10.0
84630 error npm v3.10.10
84631 error code ELIFECYCLE
84632 error [email protected] postinstall: node scripts/build.js
84632 error Exit status 1
84633 error Failed at the [email protected] postinstall script 'node scripts/build.js'.
84633 error Make sure you have the latest version of node.js and npm installed.
84633 error If you do, this is most likely a problem with the node-sass package,
84633 error not with npm itself.
84633 error Tell the author that this fails on your system:
84633 error node scripts/build.js
84633 error You can get information on how to open an issue for this project with:
84633 error npm bugs node-sass
84633 error Or if that isn't available, you can get their info via:
84633 error npm owner ls node-sass
84633 error There is likely additional logging output above.
84634 verbose exit [ 1, true ]

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

Most helpful comment

@AnthonyTsang
I found the solution:
1.add sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ to npmrc file
2.npm install -g @augular/cli

It works!!
Thanks.

All 9 comments

This is a problem with node-sass. Basically you need to install node-sass in the same environment than your running platform. Please remove node_module and run npm install again in your CentOS server.

@AnthonyTsang
thanks for your help;
but I can't install node-sass in my server util now,the error log is the same as before.

@AnthonyTsang
I found the solution:
1.add sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ to npmrc file
2.npm install -g @augular/cli

It works!!
Thanks.

Welcome to China

go ahead and watch this video. hope it helps you

https://youtu.be/Mu6btqWZszg

@aijingsun6 if you can install it at the end, maybe you should close this issue?

Dupe of https://github.com/angular/angular-cli/issues/4429, kinda fixed on https://github.com/angular/angular-cli/pull/5282 for the next release.

@aijingsun6 I did not know that workaround for users in China, I will add it to the other issue!

@psks1204 I don't see how your video is related to this issue. It looks like you're just trying to publicize it on the issue tracker.

@aijingsun6 it works for me.thanks

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings