最近我在使用create-react-app创建新的React应用程序时开始出现错误。我在下面提供了完整的错误日志:
$ npx create-react-app test-nginx-deploy
npx: installed 99 in 8.891s
Creating a new React app in C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy\react-scripts -> C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy\node_modules\react-scripts\bin\react-scripts.js
> core-js@2.6.11 postinstall C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy\node_modules\react-scripts\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.4 postinstall C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy\node_modules\react-scripts\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.4 postinstall C:\Users\jeff.barfield\Documents\B&R Fun\nginx Testing\test-nginx-deploy\node_modules\react-scripts\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ react-dom@16.13.1
+ react@16.13.1
+ cra-template@1.0.3
+ react-scripts@3.4.1
added 1591 packages from 750 contributors in 82.103s
Missing dependencies in package.json
我尝试卸载create-react-app并重新安装,但是没有运气。
**编辑:另一个要注意的事项是,在创建应用程序时,我最终在项目根目录中有2个文件,这在使用create react app时从未见过。 react-scripts.cmd和react-scripts通常都位于node_module / .bin