Windows11にReact.jsをインストールする方法
環境
OS Windows 11 Pro 21H2
node v16.16.0
npm 8.11.0
操作方法
1.create-react-appのインストール
> npm install -g create-react-app
> npm install -g create-react-app
> npm install -g create-react-app
2.プロジェクトを作成します
「sampleproject」という名前でプロジェクトを作成します
> create-react-app sampleproject
略
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 do this, you can’t go back!
We suggest that you begin by typing:
cd sampleproject
npm start
Happy hacking!
略
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 do this, you can’t go back!
We suggest that you begin by typing:
cd sampleproject
npm start
Happy hacking!
略 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 do this, you can’t go back! We suggest that you begin by typing: cd sampleproject npm start Happy hacking!
3.プロジェクトを実行します。
> cd sampleproject
>npm start
略
Compiled successfully!
You can now view sampleproject in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.86.1:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
webpack compiled successfully
略
Compiled successfully!
You can now view sampleproject in the browser.
Local: http://localhost:3000
On Your Network: http://192.168.86.1:3000
Note that the development build is not optimized.
To create a production build, use npm run build.
webpack compiled successfully
略 Compiled successfully! You can now view sampleproject in the browser. Local: http://localhost:3000 On Your Network: http://192.168.86.1:3000 Note that the development build is not optimized. To create a production build, use npm run build. webpack compiled successfully
4.ブラウザよりhttp://プライベートIP:3000にアクセスします。
「Edit src/App.js and save to reload」が表示されます。