Angular-cli: unable to install cli

Created on 7 Feb 2017  ·  24Comments  ·  Source: angular/angular-cli

user@user-Vostro-3560:~$ npm install -g angular-cli
npm ERR! registry error parsing json
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/angular-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! path /usr/local/bin/ng
npm ERR! code EEXIST

npm ERR! Refusing to delete /usr/local/bin/ng: ../lib/node_modules/@angular/cli/bin/ng symlink target is not controlled by npm /usr/local
npm ERR! File exists: /usr/local/bin/ng
npm ERR! Move it away, and try again.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/.npm/_logs/2017-02-07T11_23_43_948Z-debug.log

i couldnt find the debug file mentioned above. There is no( _log) folder in npm.

Most helpful comment

you need to remove ng from /usr/local/bin
install again
sudo npm i -g angular/cli

All 24 comments

`user@user-Vostro-3560:~$ rm -rf /usr/local/bin/ng
user@user-Vostro-3560:~$ npm install -g angular-cli
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng

[email protected] install /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node":

HTTP error 403 Forbidden

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.5
gyp verb command install [ '6.9.5' ]
gyp verb install input version string "6.9.5"
gyp verb install installing version: 6.9.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.9.5
gyp verb ensuring nodedir is created /home/user/.node-gyp/6.9.5
gyp verb created nodedir /home/user/.node-gyp/6.9.5
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.5' ]
gyp verb remove using node-gyp dir: /home/user/.node-gyp
gyp verb remove removing target version: 6.9.5
gyp verb remove removing development files for version: 6.9.5
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Linux 3.19.0-80-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
/usr/local/lib
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/angular-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/.npm/_logs/2017-02-07T11_36_53_955Z-debug.log
user@user-Vostro-3560:~$ sudo npm install -g angular-cli
[sudo] password for user:
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
/usr/local/bin/ng -> /usr/local/lib/node_modules/angular-cli/bin/ng

[email protected] install /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node":

HTTP error 403 Forbidden

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.5
gyp verb command install [ '6.9.5' ]
gyp verb install input version string "6.9.5"
gyp verb install installing version: 6.9.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.9.5
gyp verb ensuring nodedir is created /home/user/.node-gyp/6.9.5
gyp verb created nodedir /home/user/.node-gyp/6.9.5
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.5' ]
gyp verb remove using node-gyp dir: /home/user/.node-gyp
gyp verb remove removing target version: 6.9.5
gyp verb remove removing development files for version: 6.9.5
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Linux 3.19.0-80-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
/usr/local/lib
`-- (empty)

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/angular-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @angular/[email protected] requires a peer of rxjs@^5.0.1 but none was installed.
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "angular-cli"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/.npm/_logs/2017-02-07T11_39_46_310Z-debug.log
user@user-Vostro-3560:~$
`
tried both sir , not working.

Could you post the log you get from node -v & npm -v

It seems like the issue is actually with the installation of node-sass, you are getting a 403 when downloading the package from npm.

user@user-Vostro-3560:~$ ng -v Mg++ version: Mg++ 1.5beta1 (formerly MicroGnuEmacs Adv.) user@user-Vostro-3560:~$ npm -v 4.2.0 user@user-Vostro-3560:~$ node -v v6.9.5

@deepbishnoi By any chance, did you install ng-common, the Nihongo Micro Gnu Emacs ? This issue was already reported as #3759. You find a nice solution there.

removed ng-common
same result as above..
its not working

If you say the same error as before, do you actually mean this is showing in the error log:

...
npm ERR! path /usr/local/bin/ng
npm ERR! code EEXIST
..

?

If this is the case, how did you remove ng-common ?
What was the log ?

Also, instead of npm install -g angular-cli, use npm install -g @angular/cli

@deepbishnoi
You have to clean up your system, starting with finding the root cause for

gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Linux 3.19.0-80-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/angular-cli/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/angular-cli/node_modules/node-sass
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1

What happens when you do this:
npm install -g node-sass
?

Perhaps you should also perform this:
npm config set registry http://registry.npmjs.org/ --global, see https://github.com/npm/npm/issues/8872`

sudo apt remove ng-common

removed successfully
yes, the above error still exists.
also tried updating node-sass....
gives the same error

`user@user-Vostro-3560:~$ npm install node-sass

[email protected] install /home/user/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node":

HTTP error 403 Forbidden

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall /home/user/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /home/user/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/home/user/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.5
gyp verb command install [ '6.9.5' ]
gyp verb install input version string "6.9.5"
gyp verb install installing version: 6.9.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.9.5
gyp verb ensuring nodedir is created /home/user/.node-gyp/6.9.5
gyp verb created nodedir /home/user/.node-gyp/6.9.5
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.5' ]
gyp verb remove using node-gyp dir: /home/user/.node-gyp
gyp verb remove removing target version: 6.9.5
gyp verb remove removing development files for version: 6.9.5
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Linux 3.19.0-80-generic
gyp ERR! command "/usr/local/bin/node" "/home/user/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /home/user/node_modules/node-sass
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN enoent ENOENT: no such file or directory, open '/home/user/package.json'
npm WARN user No description
npm WARN user No repository field.
npm WARN user No README data
npm WARN user No license field.
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "node-sass"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/.npm/_logs/2017-02-07T12_35_35_389Z-debug.log
user@user-Vostro-3560:~$ clear

user@user-Vostro-3560:~$ npm install -g node-sass
/usr/local/bin/node-sass -> /usr/local/lib/node_modules/node-sass/bin/node-sass

[email protected] install /usr/local/lib/node_modules/node-sass
node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node
Cannot download "https://github.com/sass/node-sass/releases/download/v4.5.0/linux-x64-48_binding.node":

HTTP error 403 Forbidden

Hint: If github.com is not accessible in your location
try setting a proxy via HTTP_PROXY, e.g.

  export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

  npm config set proxy http://example.com:8080

[email protected] postinstall /usr/local/lib/node_modules/node-sass
node scripts/build.js

Building: /usr/local/bin/node /usr/local/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [ '/usr/local/bin/node',
gyp verb cli '/usr/local/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library=' ]
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb which succeeded python2 /usr/bin/python2
gyp verb check python version /usr/bin/python2 -c "import platform; print(platform.python_version());" returned: "2.7.9\n"
gyp verb get node dir no --target version specified, falling back to host node version: 6.9.5
gyp verb command install [ '6.9.5' ]
gyp verb install input version string "6.9.5"
gyp verb install installing version: 6.9.5
gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 6.9.5
gyp verb ensuring nodedir is created /home/user/.node-gyp/6.9.5
gyp verb created nodedir /home/user/.node-gyp/6.9.5
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '6.9.5' ]
gyp verb remove using node-gyp dir: /home/user/.node-gyp
gyp verb remove removing target version: 6.9.5
gyp verb remove removing development files for version: 6.9.5
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)
gyp ERR! System Linux 3.19.0-80-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/node-sass/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /usr/local/lib/node_modules/node-sass
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.5.0
gyp ERR! not ok
Build failed with error code: 1
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "node-sass"
npm ERR! node v6.9.5
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1

npm ERR! [email protected] postinstall: node scripts/build.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-sass package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node scripts/build.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-sass
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-sass
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/user/.npm/_logs/2017-02-07T12_41_37_921Z-debug.log
user@user-Vostro-3560:~$
`

What about setting
npm config set registry http://registry.npmjs.org/ --global
first, and then installing
npm install -g @angular/cli ?

Different question, are you accessing the "outside" internet via proxy ?

@catull
tried this too sir, but same error as above...
yes, I'm accessing internet in my college. I think they use proxy.

anyone there to help plz...
I'm new to linux and its very important to fix this issue...

Try asking your school's system administrator, to me this looks like an issue with your connection to NPM and whatever is between that.

I'm getting that impression from this piece of the error:
gyp http GET https://nodejs.org/download/release/v6.9.5/node-v6.9.5-headers.tar.gz
gyp WARN install got an error, rolling back install
...
gyp ERR! configure error
gyp ERR! stack Error: unable to verify the first certificate
gyp ERR! stack at Error (native)
gyp ERR! stack at TLSSocket. (_tls_wrap.js:1079:38)
gyp ERR! stack at emitNone (events.js:86:13)
gyp ERR! stack at TLSSocket.emit (events.js:185:7)
gyp ERR! stack at TLSSocket._finishInit (_tls_wrap.js:603:8)
gyp ERR! stack at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:433:38)

I'm having the same issues as well
Tried everything but still not working

@deepbishnoi @Avien
As @Ionaru already pointed out, nobody other than your system administrator can help you now.
I know this is difficult, but you have to find out which is your proxy server and how to access it.

Once you have that information, follow the suggestion at http://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy.

Good luck.

In other words, this is not an issue of Angular CLI.

its issue of proxy...
installed perfectly on home wifi..
thank you @catull @Ionaru

I am facing same issue even tried outside my home(on other networks) but didn't work

@sahilkatia from where are you installing it? I had the same issue when I was using the terminal option on my IDE. I later tried installing it from terminator (terminal). It installed within seconds. Maybe it's the way the third party terminals send requests.

you need to remove ng from /usr/local/bin
install again
sudo npm i -g angular/cli

  1. sudo nautilus
  2. go to /usr/local/bin/
  3. delete ng file
  4. then sudo npm install -g @angular/cli

    / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
    / △ \ | '_ \ / _| | | | |/ _ | '__| | | | | | |
    / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
    /_/ __| |_|__, |__,_|_|__,_|_| ____|_____|___|
    |___/

Angular CLI: 6.1.5
Node: 10.8.0
OS: linux x64
Angular:
...

Package Version

@angular-devkit/architect 0.7.5
@angular-devkit/core 0.7.5
@angular-devkit/schematics 0.7.5
@schematics/angular 0.7.5
@schematics/update 0.7.5
rxjs 6.2.2
typescript 2.9.2

The thing that worked for me as below,
Issue: Registry defined at "C:\Users*user-name*.npmrc" was wrong. Need to update npm config registry.

Step 1
Solution: Removed registry entry from "C:\Users*user-name*.npmrc" file.

Step 2
After Step 1 I got below error

npm install -g @angular/cli
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning SELF_SIGNED_CERT_IN_CHAIN: request to https://registry.npmjs.org/@angular%2fcli failed, reason: self signed certificate in certificate chain
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

Issue: The npm maintainers announced on February 27th that npm’s Self-Signed Certificate is No More:
A bunch of users received a “SELFSIGNEDCERTINCHAIN” error during installing and publishing packages throughout the day today. npm no longer supports its self-signed certificates.
However, the recommended fix failed for me.

Solution: Open command prompt, and run below commands.
SETLOCAL
SET npm_config_strict-ssl=false
npm install npm -g --ca=null
npm --version
ENDLOCAL

Step 3
Now >npm install -g @angular/cli running all ok.

i am facing below error please help me to sort out.

npm ERR! code EEXIST
npm ERR! path C:\Users\Lenovo\AppData\Roaming\npm\node_modules\create-react-app\index.js
npm ERR! dest C:\Users\Lenovo\AppData\Roaming\npm\create-react-app.cmd
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\Lenovo\AppData\Roaming\npm\node_modules\create-react-app\index.js' -> 'C:\Users\Lenovo\AppData\Roaming\npm\create-react-app.cmd'
npm ERR! File exists: C:\Users\Lenovo\AppData\Roaming\npm\create-react-app.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Lenovo\AppData\Roaming\npm-cache_logs\2020-05-20T16_49_08_456Z-debug.log

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rajjejosefsson picture rajjejosefsson  ·  3Comments

jmurphzyo picture jmurphzyo  ·  3Comments

sysmat picture sysmat  ·  3Comments

daBishMan picture daBishMan  ·  3Comments

brtnshrdr picture brtnshrdr  ·  3Comments