Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to install: Unexpected end of JSON input while parsing #546

Closed
zeke opened this issue Mar 1, 2020 · 4 comments
Closed

Unable to install: Unexpected end of JSON input while parsing #546

zeke opened this issue Mar 1, 2020 · 4 comments

Comments

@zeke
Copy link

zeke commented Mar 1, 2020

🐛 Bug Report

Hello, @mweststrate and maintainers 👋

I'm unable to install this package, but am not having trouble installing other packages.

Repro

$ npm i immer
npm ERR! Unexpected end of JSON input while parsing near '...bbUxpr2zZ5vL4G5HpDno5'
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/z/.npm/_logs/2020-03-01T06_00_42_344Z-debug.log

$ cat /Users/z/.npm/_logs/2020-03-01T06_00_42_344Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/Users/z/.nodenv/versions/12.8.0/bin/node',
1 verbose cli   '/Users/z/.nodenv/versions/12.8.0/bin/npm',
1 verbose cli   'i',
1 verbose cli   'immer'
1 verbose cli ]
2 info using npm@6.10.2
3 info using node@v12.8.0
4 verbose npm-session 3a2444e728e7034c
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/immer 109ms (from cache)
8 silly fetchPackageMetaData error for immer@latest Unexpected end of JSON input while parsing near '...bbUxpr2zZ5vL4G5HpDno5'
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 131ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...bbUxpr2zZ5vL4G5HpDno5'
11 verbose stack     at JSON.parse (<anonymous>)
11 verbose stack     at parseJson (/Users/z/.nodenv/versions/12.8.0/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
11 verbose stack     at /Users/z/.nodenv/versions/12.8.0/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50
11 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:85:5)
12 verbose cwd /Users/z/Desktop
13 verbose Darwin 19.3.0
14 verbose argv "/Users/z/.nodenv/versions/12.8.0/bin/node" "/Users/z/.nodenv/versions/12.8.0/bin/npm" "i" "immer"
15 verbose node v12.8.0
16 verbose npm  v6.10.2
17 error Unexpected end of JSON input while parsing near '...bbUxpr2zZ5vL4G5HpDno5'
18 verbose exit [ 1, true ]

To Reproduce

$ npm install immer

Environment

  • Immer version: latest
$ node --version
v12.8.0

$ uname -a
Darwin zekes-mbp.lan 19.3.0 Darwin Kernel Version 19.3.0: Thu Jan  9 20:58:23 PST 2020; root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64
@zeke
Copy link
Author

zeke commented Mar 3, 2020

False alarm. It was my environment. npm cache clean --force did the trick. Closing.

@zeke zeke closed this as completed Mar 3, 2020
@mweststrate
Copy link
Collaborator

mweststrate commented Mar 3, 2020 via email

@augum
Copy link

augum commented Jul 8, 2020

npm cache clean --force et après tu fais npm install -g npm à la fin de l'installation tu executes ta commande npm install immer

@ajablanco
Copy link

I had the same issue..
npm cach clean --force wasn't working for me.
So i deleted node modules folder
ran npm i once again..
and boom, it worked!

For anyone else having the same issues. :)

aalexand added a commit to aalexand/cloud-profiler-nodejs that referenced this issue Jun 23, 2021
This avoids persistent errors in case of rare npm cache corruptions.
Something like immerjs/immer#546.
gcf-merge-on-green bot pushed a commit to googleapis/cloud-profiler-nodejs that referenced this issue Jun 23, 2021
This should avoid persistent errors in case of rare npm cache corruptions.
Something like immerjs/immer#546.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants