問題簡(jiǎn)述
?根據(jù)react文檔上安裝命令行npx create-react-app my-app
,但是出現(xiàn)報(bào)錯(cuò)信息。信息如下
dell@dell-PC MINGW64 /e/demo
$ npx create-react-app my-app
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Files\nodejs\node_cache\_npx\17244" as it doesnot contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node_cache\_logs\2018-10-24T06_13_21_695Z-debug.log
安裝 prefix@latest 失敗,錯(cuò)誤代碼:1
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Files\nodejs\node_cache\_npx\15084" as it doesnot contain a package.json file.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Program Files\nodejs\node_cache\_logs\2018-10-24T06_13_23_624Z-debug.log
安裝 create-react-app@latest 失敗,錯(cuò)誤代碼:1
解決方法
- 改成全局安裝即可
npm install -g create-react-app
create-react-app myApp