我是新来的人。我使用npm命令安装了create-react-app。之后,当我执行命令create-react-app myapp时,它会显示此错误
Creating a new React app in C:\Users\BISWAJIT\Desktop\nodeadminuser\myreact1102020\myapp.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
C:\Users\BISWAJIT\Desktop\nodeadminuser\myreact1102020\myapp\react-scripts -> C:\Users\BISWAJIT\Desktop\nodeadminuser\myreact1102020\myapp\node_modules\react-scripts\bin\react-scripts.
> core-js@2.6.11 postinstall C:\Users\BISWAJIT\Desktop\nodeadminuser\myreact1102020\myapp\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\BISWAJIT\Desktop\nodeadminuser\myreact1102020\myapp\node_modules\react-scripts\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
+ cra-template@1.0.1
+ react-dom@16.12.0
+ react@16.12.0
+ react-scripts@3.3.1
added 1556 packages from 746 contributors in 762.12s
Missing dependencies in package.json
答案 0 :(得分:0)
如果您在计算机上安装了 NodeJS ,我们通常只需要运行命令
> npm install -g create-react-app
> npx create-react-app my-app
> cd my-app
> npm start
运行命令后。 react应该已经成功安装。我希望这会有所帮助:)