繁体   English   中英

我正在尝试运行create-react-app命令

[英]i am trying to run create-react-app command

F:\reactjs\project-1>create-react-app hello-world

Creating a new React app in F:\reactjs\project-1\hello-world.

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

npm ERR! Unexpected end of JSON input while parsing near '...dir-recursive":"^0.1.'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\HP\AppData\Roaming\npm-cache\_logs\2018-01-25T17_55_33_855Z-debug.log

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

Deleting generated file... package.json
Deleting hello-world / from F:\reactjs\project-1
Done.

我的npm版本是-5.6.0

它看起来像PATH VARIABLE问题以及npm问题。 我建议从您的计算机上卸载Node并运行最新版本,或者将npm降级到版本4。还有另一种方法:在npm modules文件夹中找到create-react-app文件夹。 ,然后复制路径,并将其直接粘贴到“高级环境变量路径”中。 是的,手动进行。 那可能会解决问题。

暂无
暂无

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

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