soon530 / reactjs-study

0 stars 0 forks source link

npx create-react-app #6

Open soon530 opened 1 year ago

soon530 commented 1 year ago

安裝教學 https://reactjs.org/docs/create-a-new-react-app.html

source code https://github.com/facebook/create-react-app

soon530 commented 1 year ago

我竟然沒有這東西?還要安裝一下...

% npx create-react-app 
Need to install the following packages:
  create-react-app
Ok to proceed? (y) y
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
Please specify the project directory:
  create-react-app <project-directory>

For example:
  create-react-app my-react-app

Run create-react-app --help to see all options.
soon530 commented 1 year ago

建新的app

% npx create-react-app .

Creating a new React app in /Users/vic/dev/reactjs-study.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

added 1394 packages in 7s

212 packages are looking for funding
  run `npm fund` for details

Installing template dependencies using npm...

added 72 packages in 1s

225 packages are looking for funding
  run `npm fund` for details
Removing template package using npm...

removed 1 package, and audited 1466 packages in 1s

225 packages are looking for funding
  run `npm fund` for details

6 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

Success! Created reactjs-study at /Users/vic/dev/reactjs-study
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 do this, you can’t go back!

We suggest that you begin by typing:

  cd /Users/vic/dev/reactjs-study
  npm start

Happy hacking!
soon530 commented 1 year ago

這樣也可以對已存在的空資料夾去建立。

npx create-react-app reactjs-study