I cant install nativescript-cli with npm when I run npm install nativescript -g. I dont know what is the reason.
node --version => 12.16.2
npm --version => 6.14.4
I tried :
-delete cache folder and npm cache clean --force
-npm config set registry http://registry.npmjs.com
-turn off anti malware
but the issue is still unresolved.
here is npm log file output
11148 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\test\function\invoke.js'
11149 warn tar ENOENT: no such file or directory, open 'C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging\es5-ext-57d686a6\function\is-arguments.js'
11150 http fetch GET 200 https://registry.npmjs.org/#sinonjs/commons/-/commons-1.6.0.tgz 22ms (from cache)
11151 verbose unlock done using C:\Users\Mohammad Reza\AppData\Roaming\npm-cache\_locks\staging-60ffea16dce7f1cb.lock for C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\.staging
11152 timing stage:rollbackFailedOptional Completed in 2ms
11153 timing stage:runTopLevelLifecycles Completed in 200098ms
11154 warn optional SKIPPING OPTIONAL DEPENDENCY: #types/node#8.10.30 (node_modules\nativescript\node_modules\#types\node):
11155 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/#types%2fnode (over 30000ms)
11156 warn optional SKIPPING OPTIONAL DEPENDENCY: typescript#3.3.4000 (node_modules\nativescript\node_modules\typescript):
11157 warn optional SKIPPING OPTIONAL DEPENDENCY: Response timeout while trying to fetch https://registry.npmjs.com/typescript (over 30000ms)
11158 verbose type body-timeout
11159 verbose stack FetchError: Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11159 verbose stack at Timeout._onTimeout (C:\Users\Mohammad Reza\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
11159 verbose stack at listOnTimeout (internal/timers.js:549:17)
11159 verbose stack at processTimers (internal/timers.js:492:7)
11160 verbose cwd C:\Windows\system32
11161 verbose Windows_NT 10.0.18363
11162 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Mohammad Reza\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "nativescript" "-g"
11163 verbose node v12.16.2
11164 verbose npm v6.14.4
11165 error Response timeout while trying to fetch https://registry.npmjs.com/pacote (over 30000ms)
11166 verbose exit [ 1, true ]
I was facing same issue, it seems to be a problem with npm versions 6.14.*. Downgrading to npm#6.13.1 worked for me.
npm i npm#6.13.1 -g
I've faced this issue and I tried all the answers on Stackoverflow but not worked for me, finally I found solution for this issue:
First of all you have to uninstall nodejs and remove all the files related him
Go to "Register Editor" and search for all "nodejs", "node.js" and delete them
Restart your computer
And reinstall nodejs then install angular.
it's worked for me,
good luck :)
Related
Error while creating a new project using angular cli .it shows
3492 verbose stack Error: 404 Not Found - GET https://registry.npmjs.org/error-ex
3492 verbose stack at C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15
3492 verbose stack at runMicrotasks (<anonymous>)
3492 verbose stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
3493 verbose statusCode 404
3494 verbose pkgid error-ex#^1.3.1
3495 verbose cwd C:\Users\amemni\Angular\test\testt
3496 verbose Windows_NT 10.0.17134
3497 verbose argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--quiet"
3498 verbose node v12.13.0
3499 verbose npm v6.12.0
3500 error code E404
3501 error 404 Not Found - GET https://registry.npmjs.org/error-ex
3502 error 404
3503 error 404 'error-ex#^1.3.1' is not in the npm registry.
3504 error 404 You should bug the author to publish it (or use the name yourself!)
3505 error 404 It was specified as a dependency of 'parse-json'
3506 error 404 Note that you can also install from a
3507 error 404 tarball, folder, http url, or git url.
3508 verbose exit [ 1, true ]
i've tried :
1 -npm clear cache --force and manually deleted the npm cache folder
2- upgrade and change angular cli version
3- change the registry with : npm config set registry http://registry.npmjs.org
None of them worked
Angular CLI: 9.0.1
Node: 12.13.0
OS: win32 ia32
Windows 10
See this issue
npm install fails with 'error-ex#^1.3.1' is not in the npm registry
There is currently a missing NPM package repository (404) - so all npms dependent on that package are broken. It's being tracked in that thread and for those of us affected, we'll update that thread as well.
Set the registry to this and , install the dependency globally. Then re-do the creation of new app.
npm config set registry http://registry.npm.taobao.org
npm install -g error-ex#1.3.1
ng new my-new-app
source :https://github.com/Qix-/node-error-ex/issues/13
I am new to ionic and i am still trying to install it. Everytime i write an ionic command like npm install -g ionic cordova i receive this error
npm ERR! Unexpected end of JSON input while parsing near '...de":"0.6.2","express"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\DwayneT\AppData\Roaming\npm-cache\_logs\2019-05-31T01_51_23_542Z-debug.log
'
this is my log file
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli
'C:\\Users\\DwayneT\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-
cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'ionic',
1 verbose cli 'cordova' ]
2 info using npm#6.9.0
3 info using node#v8.11.1
4 verbose npm-session bf0a16c3729a6897
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 http://registry.npmjs.org/cordova 1407ms (from cache)
8 silly fetchPackageMetaData error for cordova#latest Unexpected end of JSON
input while parsing near '...de":"0.6.2","express"'
9 http fetch GET 304 http://registry.npmjs.org/ionic 1418ms (from cache)
10 silly pacote tag manifest for ionic#latest fetched in 1452ms
11 timing stage:rollbackFailedOptional Completed in 1ms
12 timing stage:runTopLevelLifecycles Completed in 1466ms
13 verbose stack SyntaxError: Unexpected end of JSON input while parsing
near '...de":"0.6.2","express"'
13 verbose stack at JSON.parse (<anonymous>)
13 verbose stack at parseJson
(C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\node_modules\json-
parse-better-errors\index.js:7:17)
13 verbose stack at consumeBody.call.then.buffer
(C:\Users\DwayneT\AppData\Roaming\npm\node_modules\npm\node_modules\node-
fetch-npm\src\body.js:96:50)
13 verbose stack at <anonymous>
13 verbose stack at process._tickCallback
(internal/process/next_tick.js:188:7)
14 verbose cwd C:\Users\DwayneT
15 verbose Windows_NT 10.0.18362
16 verbose argv "C:\\Program Files\\nodejs\\node.exe"
"C:\\Users\\DwayneT\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-
cli.js" "install" "-g" "ionic" "cordova"
17 verbose node v8.11.1
18 verbose npm v6.9.0
19 error Unexpected end of JSON input while parsing near
'...de":"0.6.2","express"'
20 verbose exit [ 1, true ]
I have tried many solutions including
npm cache clean --force
but nothing seems to work and i am now now. Kindly assist please. I am using node v 8
It is the problem with npm corrupt caches. You can clear it using npm itself.
I solved it with
npm cache clean --force
then update npm
npm i npm#latest -g
then normally use your npm install command
npm install
Try run npm cache clean --force then re-run your command, I hope this fix this issue for you.
Try cleaning the npm cache use the below command. This will clean your existing npm entries and start from the beginning. I think the one file may be corrupt during the installation that's why you are facing this issue.
npm cache clean
Then try
npm install ionic -g
I've faced the problem.
when you uninstalled node js or delete the npm global packages or install the node js in a new machine that error will have occurred.
Please install global npm packages after installing the npm install or npm i
For Example My Case I've uninstalled npm global package. When I installed npm install, an error occurred.
You should clear the npm cache files manually by going to
C:\Users[Username]\AppData\Roaming\npm-cache
change [user
I've resolved this issue in the following way:
npm cache clean --force
and
npm cache verify
then
npm i npm#latest -g
and finally, I was able to run
npm i
This question already has answers here:
Error: Cannot find module '#ionic/app-scripts'
(18 answers)
Closed 3 years ago.
I'm an absolute novice in Ionic, Cordova and Node.js.
I have the following problem with Node.js:
I got a project from a colleague created with ionic and cordova. The app itself is also running, for a special customer, we have adapted the design. My thought was that it was done quickly. I changed my branch in GIT to the corresponding project and wanted to do it. Unfortunately, I get countless error messages and warnings that I did not have in the previous project.
I uninstalled Node.js and reinstalled it completely, unfortunately nothing has changed. I can not uninstall or install any of the packages. I always get this eternally long error message and I do not know exactly what the problem is. Uninstalling Ionic and cordova does not work either, same error message. Below is a listing of my version of Node.js, Ionic and cordova and the beginning and end of the error message.
Console:gitproject user$ git branch
* development
master
Console:gitproject user$ ionic cordova build
? What platform would you like to build (android, ios): ios
> ionic-app-scripts build --target cordova --platform ios
[08:44:43] ionic-app-scripts 3.2.3
[08:44:43] build dev started ...
[08:44:43] clean started ...
[08:44:43] clean finished in 24 ms
[08:44:43] copy started ...
[08:44:43] deeplinks started ...
[08:44:44] deeplinks finished in 593 ms
[08:44:44] transpile started ...
[08:44:56] typescript: src/app/app.component.ts, line: 34
Cannot find name 'Globalization'.
L33: private translate: TranslateService,
L34: private globalization: Globalization) {
L35: platform.ready().then(() => {
[08:44:56] ionic-app-script task: "build"
[08:44:56] Error: Failed to transpile program
Error: Failed to transpile program
at new BuildError (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at /path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:159:20
at new Promise (<anonymous>)
at transpileWorker (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:107:12)
at Object.transpile (/path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/transpile.js:64:12)
at /path/to/project/gitproject/node_modules/#ionic/app-scripts/dist/build.js:109:82
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts build --target cordova --platform ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Console:gitproject user$ ionic cordova plugin add cordova-plugin-globalization
> cordova plugin add cordova-plugin-globalization --save
Installing "cordova-plugin-globalization" for ios
Unable to load PlatformApi from platform. Error: Cannot find module 'unorm'
Require stack:
- /path/to/project/gitproject/platforms/ios/cordova/Api.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/plugman.js
- /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/cordova-lib.js
- /usr/local/lib/node_modules/cordova/src/help.js
- /usr/local/lib/node_modules/cordova/src/cli.js
- /usr/local/lib/node_modules/cordova/bin/cordova
Failed to install 'cordova-plugin-globalization': Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('The platform "ios" does not appear to be a valid ' +
'cordova platform. It is missing API.js. ios not ' +
'supported.')
at CordovaEventEmitter.emit (events.js:185:17)
at CordovaEventEmitter.emit (/usr/local/lib/node_modules/cordova/node_modules/cordova-common/src/events.js:69:22)
at Object.getPlatformApiFunction (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/util.js:384:20)
at Object.getPlatformApi (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/platforms/platforms.js:55:32)
at handleInstall (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:580:29)
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:349:28
at processTicksAndRejections (internal/process/task_queues.js:89:5)
Unhandled error. ('The platform "ios" does not appear to be a valid ' +
'cordova platform. It is missing API.js. ios not ' +
'supported.')
Console:gitproject user$ npm install #ionic-native/globalization
> fsevents#1.2.4 install /path/to/project/gitproject/node_modules/fsevents
> node install
node-pre-gyp WARN Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.2.4/fse-v1.2.4-node-v72-darwin-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for fsevents#1.2.4 and node#12.2.0 (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
...
...
...
...
10 warnings and 8 errors generated.
make: *** [Release/obj.target/binding/src/binding.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/path/to/project/gitproject/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:200:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/bin/node" "/path/to/project/gitproject/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /path/to/project/gitproject/node_modules/node-sass
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass#4.9.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass#4.9.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /path/to/user/folder/.npm/_logs/2019-05-27T08_04_02_672Z-debug.log
Here is the edition from the above mentioned error log
2653 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 (node_modules/fsevents):
2654 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.4 install: `node install`
2654 warn optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
2655 verbose optional SKIPPING OPTIONAL DEPENDENCY:
2655 verbose optional Failed at the fsevents#1.2.4 install script.
2655 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
2656 verbose stack Error: node-sass#4.9.0 postinstall: `node scripts/build.js`
2656 verbose stack Exit status 1
2656 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
2656 verbose stack at EventEmitter.emit (events.js:200:13)
2656 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
2656 verbose stack at ChildProcess.emit (events.js:200:13)
2656 verbose stack at maybeClose (internal/child_process.js:1021:16)
2656 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
2657 verbose pkgid node-sass#4.9.0
2658 verbose cwd /Users/premox/Documents/projects/gitproject
2659 verbose Darwin 18.6.0
2660 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "uninstall" "sass"
2661 verbose node v12.3.1
2662 verbose npm v6.9.0
2663 error code ELIFECYCLE
2664 error errno 1
2665 error node-sass#4.9.0 postinstall: `node scripts/build.js`
2665 error Exit status 1
2666 error Failed at the node-sass#4.9.0 postinstall script.
2666 error This is probably not a problem with npm. There is likely additional logging output above.
2667 verbose exit [ 1, true ]
Console:gitproject user$ node -v
v12.3.1
Console:gitproject user$ npm -v
6.9.0
Can someone explain this error message to me?
There are a couple of things you can do in order to setup the project correctly.
Check if node, ionic and cordova are properly installed.
Completely delete the node modules folder and then run the following command:-
npm install
This would install all the dependencies in the project.
If above doesnot work then you can try, same step mentioned by Ashok to resolve:-
npm install #ionic/app-scripts#latest --save-dev
Please let me know if you have any questions.
Tech details:
SurfaceBook/win10 up to date;
Node.js 8.9.4 x64
Using an admin account
The goal was to take an app (nothing special about the web app) and make it run on this laptop. It works fine on my other devices (win7 and Linux).
I tried to solve the problem with other answers from StackOverflow. I went through : Removing files (Appdata/roaming/npm & npm-cache); uninstall node.js, reinstall and such. Nothing works.
I have a strange message when using NPM (the win version) in cmd.exe prompt. But it does not talk much under Git bash.
C:\Users\TexMex>npm -v
'CALL "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\\node_modules\npm\bin\npm-cli.js" prefix -g' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
5.6.0
C:\Users\TexMex>
The Git Bash is more silent. It doesn't mean it's not going through the same problem. The "PATH" environment variableS are set properly according to other StackOverflow answers. Still... it works... Ok it's not that of a problem as long as it works.
When installing packages everything goes well until #Angular/cli. I end up with this "uglify postinstall" error every time.
[...]
34735 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
34736 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
34737 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 (node_modules\#angular\cli\node_modules\node-sass):
34738 warn optional SKIPPING OPTIONAL DEPENDENCY: node-sass#4.7.2 install: `node scripts/install.js`
34738 warn optional SKIPPING OPTIONAL DEPENDENCY: spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34739 verbose optional SKIPPING OPTIONAL DEPENDENCY:
34739 verbose optional Failed at the node-sass#4.7.2 install script.
34739 verbose optional SKIPPING OPTIONAL DEPENDENCY: This is probably not a problem with npm. There is likely additional logging output above.
34740 verbose stack Error: uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
34740 verbose stack spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34740 verbose stack at _errnoException (util.js:1022:11)
34740 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
34740 verbose stack at onErrorNT (internal/child_process.js:372:16)
34740 verbose stack at _combinedTickCallback (internal/process/next_tick.js:138:11)
34740 verbose stack at process._tickCallback (internal/process/next_tick.js:180:9)
34741 verbose pkgid uglifyjs-webpack-plugin#0.4.6
34742 verbose cwd C:\Users\TexMex\Desktop\DEV\git
34743 verbose Windows_NT 10.0.16299
34744 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "--save-dev" "#angular/cli#latest"
34745 verbose node v8.9.4
34746 verbose npm v5.6.0
34747 error file C:\WINDOWS\system32\cmd.exe;
34748 error path C:\WINDOWS\system32\cmd.exe;
34749 error code ELIFECYCLE
34750 error errno ENOENT
34751 error syscall spawn C:\WINDOWS\system32\cmd.exe;
34752 error uglifyjs-webpack-plugin#0.4.6 postinstall: `node lib/post_install.js`
34752 error spawn C:\WINDOWS\system32\cmd.exe; ENOENT
34753 error Failed at the uglifyjs-webpack-plugin#0.4.6 postinstall script.
34753 error This is probably not a problem with npm. There is likely additional logging output above.
34754 verbose exit [ 1, true ]
The thing is it prevents #angular/cli directory to be created and the corresponding files to be "landed" here (global install or not). the 'ng' command is not available as a result (it's embarrassing).
I did my homework tried all the StackOverflow answer i could find; and I'm out of ideas.
Maybe it's some spurts in the windows registry (some previous install of nodeJS)?? but what are the keys to remove from the registry if there is??? Is it relevant to clean the registry in that case? Is it specific to surface book ??? All this would be weird.
So the final question is :
How do I make it work, 100% sure shot?
Bottle in the sea... Help.
I think i found the root cause of the problem.
It seems that an online Microsoft account (which is easily activated when using W10 and SurfaceBooks) forbids software to modify some directory in the user home directory. This directory (or part of it) is somehow synchronized with the Microsoft service.
So you cannot "mess" with it like if it was only local. Those directories appear like system protected directories when using the service. When not using it; they're just hidden like you all probably know. "AppData" and such are the ones who are synchronized.
Also, I would recommend to use NodeJs/Angular with Docker. Especially as Angular is regularly updated since version 4.
It try to install angular-cli via npm on my Windows 8.1 machine and getting the error:
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 500
npm ERR! fetch failed http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
(The same command works fine on my Mac OS X, which is in the same network).
These are my (latest stable) versions (on Windows 8.1, x84):
$ node -v
v6.9.1
$ npm -v
3.10.9
$ npm install -g angular-cli
npm WARN deprecated graceful-fs#1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs#^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm ERR! fetch failed http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 500
npm ERR! fetch failed http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 500
npm ERR! fetch failed http://registry.npmjs.org/tar/-/tar-2.2.1.tgz
npm ERR! fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 500
npm ERR! fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
npm WARN retry will retry, error on last attempt: Error: fetch failed with status code 500
npm ERR! fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: tar#~2.2.1 (node_modules\angular-cli\node_modules\node-pre-gyp\node_modules\tar):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fetch failed with status code 500
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mlin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
npm ERR! node v6.9.1
npm ERR! npm v3.10.9
npm ERR! fetch failed with status code 500
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! Please include the following file with any support request:
npm ERR! C:\path\to\npm-debug.log
Looking at the npm-debug.log:
16481 verbose afterAdd C:\Users\mlin\AppData\Roaming\npm-cache\bower\1.7.9\package\package.json not in flight; writing
16482 verbose correctMkdir C:\Users\mlin\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
16483 verbose afterAdd C:\Users\mlin\AppData\Roaming\npm-cache\bower\1.7.9\package\package.json written
16484 info attempt registry request try #2 at 9:40:08 AM
16485 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16486 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16487 info retry will retry, error on last attempt: Error: server error 500
16488 info attempt registry request try #3 at 9:41:15 AM
16489 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16490 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16491 error fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16492 warn retry will retry, error on last attempt: Error: fetch failed with status code 500
16493 info retry fetch attempt 2 at 9:41:33 AM
16494 info attempt registry request try #1 at 9:41:33 AM
16495 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16496 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16497 info retry will retry, error on last attempt: Error: server error 500
16498 info attempt registry request try #2 at 9:41:51 AM
16499 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16500 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16501 info retry will retry, error on last attempt: Error: server error 500
16502 info attempt registry request try #3 at 9:42:59 AM
16503 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16504 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16505 error fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16506 warn retry will retry, error on last attempt: Error: fetch failed with status code 500
16507 info retry fetch attempt 3 at 9:44:07 AM
16508 info attempt registry request try #1 at 9:44:07 AM
16509 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16510 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16511 info retry will retry, error on last attempt: Error: server error 500
16512 info attempt registry request try #2 at 9:44:25 AM
16513 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16514 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16515 info retry will retry, error on last attempt: Error: server error 500
16516 info attempt registry request try #3 at 9:45:32 AM
16517 http fetch GET http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16518 http fetch 500 http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16519 error fetch failed http://registry.npmjs.org/npm/-/npm-2.14.21.tgz
16520 silly rollbackFailedOptional Starting
16521 silly rollbackFailedOptional Finishing
16522 silly runTopLevelLifecycles Finishing
16523 silly install printInstalled
16524 warn optional SKIPPING OPTIONAL DEPENDENCY: tar#~2.2.1 (node_modules\angular-cli\node_modules\node-pre-gyp\node_modules\tar):
16525 warn optional SKIPPING OPTIONAL DEPENDENCY: fetch failed with status code 500
16526 verbose optional SKIPPING OPTIONAL DEPENDENCY:
16526 verbose optional If you need help, you may report this error at:
16526 verbose optional SKIPPING OPTIONAL DEPENDENCY: <https://github.com/npm/npm/issues>
16527 verbose stack Error: fetch failed with status code 500
16527 verbose stack at Request.<anonymous> (C:\Users\mlin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client\lib\fetch.js:51:14)
16527 verbose stack at emitOne (events.js:96:13)
16527 verbose stack at Request.emit (events.js:188:7)
16527 verbose stack at Request.onRequestResponse (C:\Users\mlin\AppData\Roaming\npm\node_modules\npm\node_modules\request\request.js:954:10)
16527 verbose stack at emitOne (events.js:96:13)
16527 verbose stack at ClientRequest.emit (events.js:188:7)
16527 verbose stack at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:474:21)
16527 verbose stack at HTTPParser.parserOnHeadersComplete (_http_common.js:99:23)
16527 verbose stack at Socket.socketOnData (_http_client.js:363:20)
16527 verbose stack at emitOne (events.js:96:13)
16527 verbose stack at Socket.emit (events.js:188:7)
16528 verbose cwd C:\Users\mlin\Projects\jDocuments
16529 error Windows_NT 6.3.9600
16530 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mlin\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "angular-cli"
16531 error node v6.9.1
16532 error npm v3.10.9
16533 error fetch failed with status code 500
16534 error If you need help, you may report this error at:
16534 error <https://github.com/npm/npm/issues>
16535 verbose exit [ 1, true ]
Found a similar but not the same issue here: npm ERR! fetch failed status code 502
Anybody having the same problems?
Filed a ticket here just in case: https://github.com/npm/npm/issues/14510
I had a similar problem when using node 7. This seems to be related to changes in fs. When switching to node 5.10.1 things worked fine.
Here is a guide how to switch versions.
After the update, type:
sudo n 5.10.1
and try to install again.
I found the problem. It was a problem with the Sophos filter that we have here in the office network.
When I try to access http://registry.npmjs.org/tar/-/tar-2.2.1.tgz in the browser, I get:
The content could not be delivered due to the following condition:
Sweep could not proceed, the file was corrupted
Screenshot: https://snag.gy/THdcZF.jpg
Found this issue reported in the Sophos forum:
https://community.sophos.com/products/unified-threat-management/f/web-protection-web-filtering-application-visibility-control/79592/problem-downloading-a-zip-file---error-message-is-sweep-could-not-proceed-the-file-was-corrupted
(My Mac was using the company wifi but is not part of the domain, while my Windows PC is.)