I am running the installation of JHipster:
npm install -g generator-jhipster
and got the following error:
npm ERR! Unexpected end of JSON input while parsing near '...^0.1.7","karma-ie-lau'
my system versions are:
npm -version ; 6.4.1
java -version ; 1.8.0_112
git --version ; 2.17.1.window.2
mvn -version ; 3.6.1
my log file is as below :
113 silly pacote version manifest for jhipster-core#6.0.5 fetched in 1565ms
114 silly resolveWithNewModule jhipster-core#6.0.5 checking installable status
115 http fetch GET 200 https://registry.npmjs.org/glob 1979858ms
116 silly fetchPackageMetaData error for glob#7.1.3 Unexpected end of JSON input while parsing near '...04ddd01e","tarball":"'
117 http fetch GET 200 https://registry.npmjs.org/chalk 1979867ms
118 silly fetchPackageMetaData error for chalk#2.4.2 Unexpected end of JSON input while parsing near '...==","shasum":"3f73c2b'
119 timing stage:rollbackFailedOptional Completed in 1ms
120 timing stage:runTopLevelLifecycles Completed in 1984843ms
121 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...04ddd01e","tarball":"'
121 verbose stack at JSON.parse (<anonymous>)
121 verbose stack at parseJson (C:\ProgramFiles\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
121 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
121 verbose stack at <anonymous>
121 verbose stack at process._tickCallback (internal/process/next_tick.js:189:7)
122 verbose cwd C:\jhipster
123 verbose Windows_NT 6.1.7601
124 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "generator-jhipster"
125 verbose node v8.16.1
126 verbose npm v6.4.1
127 error Unexpected end of JSON input while parsing near '...04ddd01e","tarball":"'
128 verbose exit [ 1, true ]
I really need some help or hints on how this can be handled.
Thank you and best regards,
Alvin
Related
While installing angular on my machine I am getting the below error. Uninstall and installed Node multiple times. But it is not helping. I have given the error log below. Can anyone help me in sorting this?
3 silly resolveWithNewModule universal-analytics#0.4.20 checking installable status
324 silly pacote version manifest for uuid#7.0.2 fetched in 298ms
325 silly resolveWithNewModule uuid#7.0.2 checking installable status
326 timing stage:rollbackFailedOptional Completed in 2ms
327 timing stage:runTopLevelLifecycles Completed in 9824ms
328 verbose stack Error: UNKNOWN: unknown error, open 'C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f'
329 verbose cwd C:\Users\Shally.BBYBSDC
330 verbose Windows_NT 10.0.18362
331 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "#angular/cli"
332 verbose node v14.4.0
333 verbose npm v6.14.5
334 error code UNKNOWN
335 error syscall open
336 error path C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f
337 error errno -4094
338 error UNKNOWN: unknown error, open 'C:\Users\Shally.BBYBSDC\AppData\Roaming\npm-cache\_cacache\index-v5\1f\85\3e0b21cc5deb10a0dc51ed6dace9f5ae0f08f66b5c064b262517165cfa2f'
339 verbose exit [ -4094, true ]
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:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'react-bootstrap',
1 verbose cli 'bootstrap'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.17.0
4 verbose npm-session 4004d1d4d37ac517
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 200 https://registry.npmjs.org/react-bootstrap 521ms
8 silly fetchPackageMetaData error for react-bootstrap#latest Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
9 http fetch GET 200 https://registry.npmjs.org/bootstrap 521ms
10 silly fetchPackageMetaData error for bootstrap#latest Unexpected end of JSON input while parsing near '...7bc2df7ec608869c9c8",'
11 timing stage:rollbackFailedOptional Completed in 0ms
12 timing stage:runTopLevelLifecycles Completed in 3560ms
13 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
13 verbose stack at JSON.parse (<anonymous>)
13 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
13 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
13 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
14 verbose cwd D:\Talk2Tutor\material-kit-react-master
15 verbose Windows_NT 10.0.17134
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "react-bootstrap" "bootstrap"
17 verbose node v12.17.0
18 verbose npm v6.14.4
19 error Unexpected end of JSON input while parsing near '...,"requirejs":"~2.1.9"'
20 verbose exit [ 1, true ]
I got above error while running npm i react-bootstrap bootstrap. After the error occurred, I tried npm cache clean --force but it didn't resolve my problem. Then I reinstalled node and tried to install dependencies but I still get an error and installation is failed. Any one fixed this error. I tried all the things mentioned in the related question. But it didn't solve my problem. I use node v12.17.0 and npm 6.14.4.
I tried by executing command npm cache clean --force and then executed the command that caused this error and it worked fine.
Upgrade npm using npm-windows-upgrade solved the issue.
After running the command npm cache clean --force . You need to remove the package-lock.json file. This worked for me.
Popper.js is required if you're using Bootstrap JS. Check the docs
I have an Artifactory NPM repo named product_release_npm, with anonymous access disabled.
At the project level, I have an .npmrc file with the following content :
#luciad:registry=https://[DOMAIN]/artifactory/api/npm/product_release_npm/
At the user level, I have an .npmrc file with the following content :
//[DOMAIN]/artifactory/api/npm/product_thirdparty_npm/:_authToken=[AUTH_TOKEN]
//[DOMAIN]/artifactory/api/npm/product_release_npm/:_authToken=[AUTH_TOKEN]
My project's package.json file looks like this :
{
"dependencies": {
"#luciad/ria-core": "^2019.0"
}
}
If I do an npm install with NPM 4.2.0 or lower, I'm able to install this repo succesfully.
If I try the same thing with NPM 5.0.0 or higher, I'm unable to install this repo and get a 404 error.
In some versions of NPM, I'm also getting a 403 error.
Here's the log when try this with NPM 5.6.0, on a Linux machine :
0 info it worked if it ends with ok
1 verbose cli [ '/home/release/nodejs/node-v8.11.1-linux-x64/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install' ]
2 info using npm#5.6.0
3 info using node#v8.11.1
4 verbose npm-session 63d1960eac6e1e9a
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 silly install loadShrinkwrap
13 silly install loadAllDepsIntoIdealTree
14 http fetch GET 200 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 334ms
15 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 32ms
16 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
17 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 9ms
18 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found: #luciad/ria-core#^2019.0
19 silly saveTree release
20 verbose stack Error: 404 Not Found: #luciad/ria-core#^2019.0
20 verbose stack at fetch.then.res (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/fetch.js:42:19)
20 verbose stack at tryCatcher (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
20 verbose stack at Promise._settlePromiseFromHandler (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
20 verbose stack at Promise._settlePromise (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
20 verbose stack at Promise._settlePromise0 (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
20 verbose stack at Promise._settlePromises (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
20 verbose stack at Async._drainQueue (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:133:16)
20 verbose stack at Async._drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:143:10)
20 verbose stack at Immediate.Async.drainQueues (/home/release/nodejs/node-v8.11.1-linux-x64/lib/node_modules/npm/node_modules/bluebird/js/release/async.js:17:14)
20 verbose stack at runCallback (timers.js:794:20)
20 verbose stack at tryOnImmediate (timers.js:752:5)
20 verbose stack at processImmediate [as _immediateCallback] (timers.js:729:5)
21 verbose cwd /home/release/Desktop/artifactory/release
22 verbose Linux 4.15.0-65-generic
23 verbose argv "/home/release/nodejs/node-v8.11.1-linux-x64/bin/node" "/usr/local/bin/npm" "install"
24 verbose node v8.11.1
25 verbose npm v5.6.0
26 error code E404
27 error 404 Not Found: #luciad/ria-core#^2019.0
28 verbose exit [ 1, true ]
Here's the log when try this with NPM 6.9.0, on a Windows machine :
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install' ]
2 info using npm#6.9.0
3 info using node#v10.16.3
4 verbose npm-session e99caa5e8a2881d2
5 silly install runPreinstallTopLevelLifecycles
6 silly preinstall release
7 info lifecycle #~preinstall: #
8 silly install loadCurrentTree
9 silly install readLocalPackageData
10 timing stage:loadCurrentTree Completed in 13ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
16 silly install loadAllDepsIntoIdealTree
17 http fetch GET 304 https://[DOMAIN]/artifactory/api/npm/product_release_npm/#luciad%2fria-core 143ms
18 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 12ms
19 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
20 http fetch GET 404 https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz 10ms
21 silly fetchPackageMetaData error for #luciad/ria-core#^2019.0 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
22 timing stage:rollbackFailedOptional Completed in 0ms
23 timing stage:runTopLevelLifecycles Completed in 248ms
24 silly saveTree release
25 verbose stack Error: 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
25 verbose stack at res.buffer.catch.then.body (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-response.js:104:15)
25 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
26 verbose statusCode 404
27 verbose pkgid #luciad/ria-core#^2019.0
28 verbose cwd D:\Desktop\EXPERIMENT\artifactory\release
29 verbose Windows_NT 10.0.16299
30 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
31 verbose node v10.16.3
32 verbose npm v6.9.0
33 error code E404
34 error 404 Not Found - GET https://[DOMAIN]:443/artifactory/api/npm/product_release_npm/#luciad/ria-core/-/#luciad/ria-core-2019.0.1.tgz
35 error 404
36 error 404 '#luciad/ria-core#^2019.0' is not in the npm registry.
37 error 404 You should bug the author to publish it (or use the name yourself!)
38 error 404 Note that you can also install from a
39 error 404 tarball, folder, http url, or git url.
40 verbose exit [ 1, true ]
Any idea what might be causing this and/or how to fix this issue?
I'am trying to install react-native-cli but getting error
npm install -g react-native-cli
getting this error
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'react-native-cli' ]
2 info using npm#6.4.1
3 info using node#v10.15.0
4 verbose npm-session 72c72ae6cf674a04
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 http://registry.npmjs.org/react-native-cli 247ms
8 silly fetchPackageMetaData error for react-native-cli#latest Unexpected token < in JSON at position 0 while parsing near '<HTML><HEAD>
8 silly fetchPackageMetaData <meta h...'
9 timing stage:rollbackFailedOptional Completed in 1ms
10 timing stage:runTopLevelLifecycles Completed in 568ms
11 verbose stack SyntaxError: Unexpected token < in JSON at position 0 while parsing near '<HTML><HEAD>
11 verbose stack <meta h...'
11 verbose stack at JSON.parse (<anonymous>)
11 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
11 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50)
11 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7)
12 verbose cwd C:\Users\Basva
13 verbose Windows_NT 10.0.17134
14 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "react-native-cli"
15 verbose node v10.15.0
16 verbose npm v6.4.1
17 error Unexpected token < in JSON at position 0 while parsing near '<HTML><HEAD>
17 error <meta h...'
18 verbose exit [ 1, true ]
What may be the wrong..!!!?
Make sure whether your npm package correctly install.I solved this problem following below step.Try it..
npm i -g npm
npm cache clean
npm update
npm i
I think https://facebook.github.io/react-native/docs/getting-started.html is more useful for your.
I am a regular react user and usually use create-react-app but from this morning it is not working.
I have checked the npm, it is installed and fine. I have checked that create-react-app is globally installed on my system. The error is coming with some JSON file.
Versions installed on my system:
node -v
v9.0.0
$ npm -v
5.5.1
I have attached the log file below, I'm attaching log file from where the error comes first:
917 http fetch GET 200 https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex 19ms (from cache)
918 silly fetchPackageMetaData error for babel-plugin-transform-es2015-unicode-regex#^6.22.0 Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
919 silly pacote range manifest for babel-plugin-transform-es2015-sticky-regex#^6.22.0 fetched in 25ms
920 silly resolveWithNewModule babel-plugin-transform-es2015-sticky-regex#6.24.1 checking installable status
921 silly pacote range manifest for babel-plugin-transform-es2015-template-literals#^6.22.0 fetched in 24ms
922 silly resolveWithNewModule babel-plugin-transform-es2015-template-literals#6.22.0 checking installable status
923 silly pacote range manifest for babel-plugin-transform-exponentiation-operator#^6.22.0 fetched in 23ms
924 silly resolveWithNewModule babel-plugin-transform-exponentiation-operator#6.24.1 checking installable status
925 silly pacote range manifest for babel-plugin-transform-es2015-typeof-symbol#^6.23.0 fetched in 24ms
926 silly resolveWithNewModule babel-plugin-transform-es2015-typeof-symbol#6.23.0 checking installable status
927 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
927 verbose stack at JSON.parse (<anonymous>)
927 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
927 verbose stack at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
927 verbose stack at <anonymous>
927 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
928 verbose cwd C:\Users\ashve\Desktop\Startup\startup
929 verbose Windows_NT 10.0.17134
930 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--save" "--save-exact" "--loglevel" "error" "react" "react-dom" "react-scripts"
931 verbose node v9.0.0
932 verbose npm v5.5.1
933 error Unexpected end of JSON input while parsing near '....7":{"name":"babel-pl'
934 verbose exit [ 1, true ]
I saw you're using Windows. Try to clean the cache.
npm cache clean --force
or
Goto %appdata%\npm-cache and check if the directory is clean or not. If not, delete all file from the directory manually.
Now try create-react-app yourAppName