npm install报错Unexpected end of JSON input while parsing near '...ersion":"4.5.0","depe'
程序员文章站
2022-03-03 17:48:00
...
这两天执行 npm install 时会报错误:
17971 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ersion":"4.5.0","depe'
17971 verbose stack at JSON.parse (<anonymous>)
17971 verbose stack at parseJson (C:\Users\Administrator.CE-20151109NQJC\AppData\Roaming\npm\node_modules\npm\node_modules\json-parse-better-errors\index.js:7:17)
17971 verbose stack at C:\Users\Administrator.CE-20151109NQJC\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\body.js:96:50
17971 verbose stack at runMicrotasks (<anonymous>)
17971 verbose stack at processTicksAndRejections (internal/process/task_queues.js:94:5)
17972 verbose cwd E:\workspaces\multiplatform
17973 verbose Windows_NT 6.1.7601
17974 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Administrator.CE-20151109NQJC\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install"
17975 verbose node v12.14.1
17976 verbose npm v6.13.6
17977 error Unexpected end of JSON input while parsing near '...ersion":"4.5.0","depe'
17978 verbose exit [ 1, true ]
这个错误的解决方法有以下几种:
1.删掉package.lock.json
2.清除cache
npm cache clean --force
3.进入下面这个文件夹清除cache
路径:C:/Users/PC/AppData/Roaming/npm-cache
执行:
npm cache clean --force
4.不要用淘宝镜像。
npm set registry https://registry.npmjs.org/
上一篇: npm install 报错:error Unexpected end of JSON input while parsing near '...https://registry.npmj'的解决办法
推荐阅读
-
亲测解决npm ERR! Unexpected end of JSON input while parsing near...的方法
-
npm ERR! Unexpected end of JSON input while parsing near
-
npm ERR! Unexpected end of JSON input while parsing near '...Rg9e9zaVBZ
-
解决npm ERR! Unexpected end of JSON input while parsing near的报错问题
-
vue npm安装webpack报错:Unexpected end of JSON input while parsing near
-
npm install出现Unexpected end of JSON input while parsing near错误解决方法
-
npm install出现Unexpected end of JSON input while parsing near错误解决方法
-
npm install出现"Unexpected end of JSON input while parsing near"错误解决方法
-
npm install出现"Unexpected end of JSON input while parsing near"错误解决方法
-
npm install出现"Unexpected end of JSON input while parsing near"错误解决方法