【发布时间】:2020-09-23 04:06:50
【问题描述】:
我想运行我的第一个 React 应用
我已经安装了节点
我已经使用npm install -g create-react-app 全局安装了 react
但是当我想使用 npx 创建反应应用程序时会发生这种情况
C:\Users\deep>npm install -g create-react-app
C:\Users\deep\AppData\Roaming\npm\create-react-app -> C:\Users\deep\AppData\Roaming\npm\node_modules\create-react-app\index.js
+ create-react-app@3.4.1
updated 1 package in 14.608s
C:\Users\deep>cd Desktop
C:\Users\deep\Desktop>cd lets go
C:\Users\deep\Desktop\lets go>npx create-react-app myfirstreact
Creating a new React app in C:\Users\deep\Desktop\lets go\myfirstreact.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
> core-js@2.6.11 postinstall C:\Users\deep\Desktop\lets go\myfirstreact\node_modules\babel-runtime\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js@3.6.5 postinstall C:\Users\deep\Desktop\lets go\myfirstreact\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> core-js-pure@3.6.5 postinstall C:\Users\deep\Desktop\lets go\myfirstreact\node_modules\core-js-pure
> node -e "try{require('./postinstall')}catch(e){}"
+ react-scripts@3.4.1
+ react-dom@16.13.1
+ cra-template@1.0.3
+ react@16.13.1
added 1627 packages from 752 contributors in 367.744s
59 packages are looking for funding
run `npm fund` for details
我应该如何运行我的第一个 react 应用程序?
【问题讨论】:
-
只要做
npm run start,就设置成功了。
标签: javascript node.js reactjs react-native npm