简体   繁体   English

npm 错误! 解析 '..."jscs":"~3.0.7","moch' 附近时 JSON 输入意外结束

[英]npm ERR! Unexpected end of JSON input while parsing near '..."jscs":"~3.0.7","moch'

I have a problem with npm.我对 npm 有问题。 I tried: npx create-react-app my-app but it returned an error.我试过: npx create-react-app my-app但它返回了一个错误。

My command prompt output:我的命令提示符输出:

c:\Users\sysli\Desktop\reactprojects>npx create-react-app my-app
npx: installed 91 in 34.825s

Creating a new React app in c:\Users\sysli\Desktop\reactprojects\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! Unexpected end of JSON input while parsing near '..."jscs":"~3.0.7","moch'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\sysli\AppData\Roaming\npm-cache\_logs\2019-12-26T21_21_02_198Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.

Deleting generated file... package.json
Deleting my-app/ from c:\Users\sysli\Desktop\reactprojects
Done.

Log file: https://justpaste.it/3s5ym日志文件: https : //justpaste.it/3s5ym

Update npm on your machine ( Prasool advice ):在您的机器上更新 npm( Prasool 建议):

sudo npm i -g npm

If it does not work as expected, please use如果它没有按预期工作,请使用

npm cache clean --force

as it seems to work for some around here and GitHub.因为它似乎适用于这里和 GitHub 的一些人。 :) :)

Have a happy coding time!有一个快乐的编码时间!

Can you retry after updating npm?更新 npm 后可以重试吗?

npm install -g npm npm install -g npm

Please note that this command will remove your current version of npm.请注意,此命令将删除您当前版本的 npm。 Make sure to use sudo npm install -g npm if on a Mac.如果在 Mac 上,请确保使用 sudo npm install -g npm。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 npm 错误! 解析 ' 附近时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near ' “npm ERR,在附近解析时 JSON 输入意外结束”。 在安装 express.js 时 - “npm ERR! Unexpected end of JSON input while parsing near”, while installing express.js npm 错误! 在“…w2BfLygJAO9ZBvYIqZTld”附近解析时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near '…w2BfLygJAO9ZBvYIqZTld' Angular ng 新投掷错误:npm ERR! 解析附近时 JSON 输入意外结束 - Angular ng new throwing error: npm ERR! Unexpected end of JSON input while parsing near npm 错误。 在“...tore-4.0.0,tgz”,“文件”附近解析时输入意外结束 JSON - npm ERR! Unexpected end of JSON input while parsing near '...tore-4.0.0.tgz","file' npm 错误! 在 '...ob":"^7.0.0","istanbu' 附近解析时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near '...ob":"^7.0.0","istanbu' npm 错误! 解析 '.../openpgpjs.org\\r\\n\\r\\' 附近时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near '.../openpgpjs.org\r\n\r\' npm 错误! 解析 '...registry.npmjs.org/@i' 附近时 JSON 输入意外结束 - npm ERR! Unexpected end of JSON input while parsing near '...registry.npmjs.org/@i' npm ERR:JSON 输入意外结束,同时在 '...nt“.”^7.1,0“,”babel-p' 附近解析 - npm ERR! Unexpected end of JSON input while parsing near '…nt“:”^7.1.0“,”babel-p' npm 安装错误在解析附近时 JSON 输入意外结束 - npm install error Unexpected end of JSON input while parsing near
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM