Node.js npm错误!在';附近解析时JSON输入意外结束&引用;jscs”是:&引用~3.0.7&引用;moch&x27;
我对npm有问题。我尝试了:Node.js npm错误!在';附近解析时JSON输入意外结束&引用;jscs”是:&引用~3.0.7&引用;moch&x27;,node.js,reactjs,npm,Node.js,Reactjs,Npm,我对npm有问题。我尝试了:npx create react app my app,但它返回了一个错误 我的命令提示符输出: 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 pack
npx create react app my app
,但它返回了一个错误
我的命令提示符输出:
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.
日志文件:
更新npm后,您能重试吗 npm安装-g npm 请注意,此命令将删除当前版本的npm。确保使用
sudo npm安装-g npm(如果在Mac上)。在您的机器上更新npm(Prasool建议): 如果不能按预期工作,请使用
npm cache clean --force
因为它似乎对这里和GitHub附近的一些人有效。:)
祝你玩得开心 “摩卡”
npm cache clean --force