vuejs-templates / webpack

A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

npm ERR! Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'

Brindha16 opened this issue · comments

Getting exceptions when trying to run npm install -g gulp in Windows -

C:\Users\username\Downloads\MEC Static Code (3)\MEC Static Code>npm install -g gulp
npm ERR! Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\username\AppData\Roaming\npm-cache_logs\2021-01-04T00_51_19_233Z-debug.log

Detailed logs :

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Users\username\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'gulp'
1 verbose cli ]
2 info using npm@6.14.10
3 info using node@v12.18.0
4 verbose npm-session f59c421986d1e208
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 304 https://registry.npmjs.org/gulp 495ms (from cache)
8 http fetch GET 200 https://registry.npmjs.org/gulp/-/gulp-4.0.2.tgz 26ms (from cache)
9 silly pacote tag manifest for gulp@latest fetched in 597ms
10 timing stage:loadCurrentTree Completed in 627ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
16 silly install loadAllDepsIntoIdealTree
17 silly resolveWithNewModule gulp@4.0.2 checking installable status
18 http fetch GET 304 https://registry.npmjs.org/undertaker 420ms (from cache)
19 silly pacote range manifest for undertaker@^1.2.1 fetched in 428ms
20 silly resolveWithNewModule undertaker@1.3.0 checking installable status
21 http fetch GET 304 https://registry.npmjs.org/glob-watcher 465ms (from cache)
22 silly pacote range manifest for glob-watcher@^5.0.3 fetched in 472ms
23 silly resolveWithNewModule glob-watcher@5.0.5 checking installable status
24 http fetch GET 304 https://registry.npmjs.org/vinyl-fs 467ms (from cache)
25 silly fetchPackageMetaData error for vinyl-fs@^3.0.0 Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'
26 http fetch GET 304 https://registry.npmjs.org/gulp-cli 481ms (from cache)
27 silly pacote range manifest for gulp-cli@^2.2.0 fetched in 484ms
28 silly resolveWithNewModule gulp-cli@2.3.0 checking installable status
29 timing stage:rollbackFailedOptional Completed in 1ms
30 timing stage:runTopLevelLifecycles Completed in 1134ms
31 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'
31 verbose stack at JSON.parse ()
31 verbose stack at parseJson (C:\Users\username\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
31 verbose stack at C:\Users\username\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
31 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
32 verbose cwd C:\Users\username\Downloads\MEC Static Code (3)\MEC Static Code
33 verbose Windows_NT 10.0.18363
34 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\username\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "gulp"
35 verbose node v12.18.0
36 verbose npm v6.14.10
37 error Unexpected end of JSON input while parsing near '.../registry.npmjs.org/v'
38 verbose exit [ 1, true ]

Versions:

node v12.18.0
npm v6.14.10
Git v2.27.0.windows.1

I tried cache clean --force and tried to uninstall and installed nodeJS and chocolatey dependencies and manually deleted npm cache folder in AppData\Roaming. Still getting "JSON Parsing error" when running the command.

Any other suggestions to resolve this issue would be really helpful. Please let me know for any additional information. Thanks!!