简体   繁体   中英

npm error while installing express in nodejs

I am facing a problem while npm install express . Unexpected end of JSON input while parsing near '..."dist":{"shasum":"e84' this is the erroe i am getting.

>  0 info it worked if it ends with ok
>         1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
>         1 verbose cli   'C:\\Users\\Rakshith Rakshak\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
>         1 verbose cli   'install',
>         1 verbose cli   '-g',
>         1 verbose cli   'express' ]
>         2 info using npm@6.9.2
>         3 info using node@v10.15.3
>         4 verbose npm-session 203510227a9454ec
>         5 silly install loadCurrentTree
>         6 silly install readGlobalPackageData
>         7 http fetch GET 304 https://registry.npmjs.org/express 346ms (from cache)
>         8 silly fetchPackageMetaData error for express@latest Unexpected end of JSON input while parsing near
> '..."dist":{"shasum":"e84'
>         9 timing stage:rollbackFailedOptional Completed in 1ms
>         10 timing stage:runTopLevelLifecycles Completed in 417ms
>         11 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."dist":{"shasum":"e84'
>         11 verbose stack     at JSON.parse (<anonymous>)
>         11 verbose stack     at parseJson (C:\Users\Rakshith Rakshak\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
>         11 verbose stack     at consumeBody.call.then.buffer (C:\Users\Rakshith
> Rakshak\AppData\Roaming\npm\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 D:\My Files\node\role-based-auth
>         13 verbose Windows_NT 10.0.18362
>         14 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Rakshith
> Rakshak\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js"
> "install" "-g" "express"
>         15 verbose node v10.15.3
>         16 verbose npm  v6.9.2
>         17 error Unexpected end of JSON input while parsing near '..."dist":{"shasum":"e84'
>         18 verbose exit [ 1, true ]

Clear NPM cache and try installing 'Express' again. Run Below command

npm cache clean --force

then install express

  npm install express

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM