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

Unexpected end of JSON input while parsing near '...:false,"directories":' #9

Closed
justinhartman opened this issue Oct 1, 2018 · 4 comments

Comments

@justinhartman
Copy link

There is a problem when trying to install buffer-indexof, either directly or as part of a package. I have logged this issue with Grafite as they use your package and I am unable to run npm install on the Grafite project as a result.

When running npm i buffer-indexof here is the error:

$ npm i buffer-indexof
npm ERR! Unexpected end of JSON input while parsing near '...:false,"directories":'

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mbp/.npm/_logs/2018-10-01T23_05_16_572Z-debug.log

And here is the debug log file referred to above:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'i',
1 verbose cli   'buffer-indexof' ]
2 info using npm@6.4.1
3 info using node@v8.11.3
4 verbose npm-session e7171489533cd7b6
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/buffer-indexof 71008ms attempt #3 (from cache)
8 silly fetchPackageMetaData error for buffer-indexof@latest Unexpected end of JSON input while parsing near '...:false,"directories":'
9 timing stage:rollbackFailedOptional Completed in 3ms
10 timing stage:runTopLevelLifecycles Completed in 71509ms
11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...:false,"directories":'
11 verbose stack     at JSON.parse (<anonymous>)
11 verbose stack     at parseJson (/usr/local/lib/node_modules/npm/node_modules/json-parse-better-errors/index.js:7:17)
11 verbose stack     at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/node-fetch-npm/src/body.js:96:50)
11 verbose stack     at <anonymous>
11 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
12 verbose cwd /Volumes/500GB/Mega/Code/GitLab/grafite
13 verbose Darwin 17.7.0
14 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "i" "buffer-indexof"
15 verbose node v8.11.3
16 verbose npm  v6.4.1
17 error Unexpected end of JSON input while parsing near '...:false,"directories":'
18 verbose exit [ 1, true ]

My Environment:

  • OS: macOS 10.13.6
  • Node: v8.11.3
  • NPM: 6.4.1
  • Darwin: 17.7.0
  • Composer: 1.6.5
@justinhartman
Copy link
Author

This project looks dead. Are you guys maintaining this project or is it abandonware?

@soldair
Copy link
Owner

soldair commented Oct 2, 2018

i maintain it =)
node core has had indexOf forever so its much less useful than before but it should just keep working.

@soldair
Copy link
Owner

soldair commented Oct 2, 2018

7 http fetch GET 304 https://registry.npmjs.org/buffer-indexof 71008ms attempt #3 (from cache)

it looks like the npm registry served a broken json!
whatever their issue was it seems to be resolved now =)

@soldair soldair closed this as completed Oct 2, 2018
@soldair
Copy link
Owner

soldair commented Oct 2, 2018

please reopen if you find its still broken.
perhaps run npm cache-clear --force

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

2 participants