==TODOSTEP-01`使用npm安装react脚手架`C:\Users\Administrator>npm i -g create-react-app
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
changed 67 packages in 3s
==TODOSTEP-02`使用react脚手架创建react demo项目`C:\Users\Administrator>create-react-app my-demoreact
Creating a newReact app inC:\Users\Administrator\my-demoreact.
Installing template dependencies using npm...
added 69 packages, and changed 1packagein 16s
Removing template package using npm...
removed 1packagein 5s
==TODOSTEP-03`创建react demo项目成功`C:\Users\Administrator>cd C:\Users\Administrator\my-demoreact
Success! Created my-demoreact at C:\Users\Administrator\my-demoreact
Inside that directory, you can run several commands:
npm start
Starts the development server.
npm run build
Bundles the app into static files for production.
npm test
Starts the test runner.
npm run eject
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you dothis, you can’t go back!
We suggest that you begin by typing:
cd my-demoreact
npm start
Happy hacking!
==TODOSTEP-05`启动react demo项目`C:\Users\Administrator\my-demoreact>npm start
> my-demoreact@0.1.0 start
> react-scripts start(node:3112)[DEP_WEBPACK_DEV_SERVER_ON_AFTER_SETUP_MIDDLEWARE] DeprecationWarning:'onAfterSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.(Use `node --trace-deprecation ...` to show where the warning was created)(node:3112)[DEP_WEBPACK_DEV_SERVER_ON_BEFORE_SETUP_MIDDLEWARE] DeprecationWarning:'onBeforeSetupMiddleware' option is deprecated. Please use the 'setupMiddlewares' option.
Starting the development server...
One of your dependencies, babel-preset-react-app, is importing the
"@babel/plugin-proposal-private-property-in-object"package without
declaring it in its dependencies. This is currently working because
"@babel/plugin-proposal-private-property-in-object" is already in your
node_modules folder for unrelated reasons, but it may break at any time.
babel-preset-react-app is part of the create-react-app project, which
is not maintianed anymore. It is thus unlikely that this bug will
ever be fixed. Add "@babel/plugin-proposal-private-property-in-object" to
your devDependencies to work around this error. This will make this message
go away.
Compiled successfully!
==TODOSTEP-06`启动成功,使用浏览器打开react demo项目`
You can now view my-demoreact in the browser.Local: http://localhost:3000
On Your Network: http://192.168.124.243:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
webpack compiled successfully