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

Invalid JSON input while installing latest package of protoduck #6

Open
RupeshDeshmukh opened this issue Feb 26, 2019 · 2 comments
Open

Comments

@RupeshDeshmukh
Copy link

We are getting below mentioned invalid JSON error while installing the latest (5.0.1) version of protoduck npm package from Nexus.

2019-02-26 04:11:04,473+0000 WARN [qtp365971833-490] admin org.sonatype.nexus.repository.npm.internal.NpmHandlers - Error: GET /protoduck: Status{successful=false, code=404, message='Not Found'} - Invalid JSON input org.sonatype.nexus.repository.InvalidContentException: Invalid JSON input at org.sonatype.nexus.repository.npm.internal.NpmJsonUtils.parse(NpmJsonUtils.java:88)

Caused by: com.fasterxml.jackson.core.JsonParseException: Illegal unquoted character ((CTRL-CHAR, code 0)): has to be escaped using backslash to be included in string value at [Source: (BufferedInputStream); line: 1, column: 2103] at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1798) at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:663) at com.fasterxml.jackson.core.base.ParserMinimalBase._throwUnquotedSpace(ParserMinimalBase.java:627) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishString2(UTF8StreamJsonParser.java:2479) at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._finishAndReturnString(UTF8StreamJsonParser.java:2408)
In nexus there is strict validation of json files while installing them on local repos. The package installation works fine when installed independently using npm i. But it gives JSON parsing error while installing package via Nexus.

@mistic100
Copy link

I "fixed" the issue by deleting the package from the proxy a re-publishing it in our own repository after cleaning the package.json file (just did "Remove whitespaces" on http://jsonviewer.stack.hu/).

It is clearly a problem with an invisible character somewhere, perhaps a BOM at the begining of the file.

Also filed on issue on Nexus https://issues.sonatype.org/browse/NEXUS-19189

@peter-snr
Copy link

peter-snr commented Feb 27, 2019

This is breaking all my builds, any ideas what to do?

$ npm install -g @angular/cli@6
...
...
...
npm ERR! Linux 4.15.0-1032-aws
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "@angular/cli@6"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2

npm ERR! Unexpected token in JSON at position 2100
npm ERR! {"_id":"protoduck","_rev":"12-f055a178db3959d03406b3994f0226c8","name":"protoduck","description":"Fancy duck typing for the most serious of ducks.","dist-tags":{"latest":"5.0.1"}

Finally fixed this.
I had an old version of npm hanging around (3.5.2) so I just update my node installation to the latest stable version and it was all fixed.

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

3 participants