0

Okay, the title might be confusing but I think my problem is pretty easy to explain with just the terminal code. My questions are below the code wall. emphasized text

[fsevents] Success: "/Users/Name/my-app/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" already installed
Pass --update-binary to reinstall or --build-from-source to recompile
+ react-dom@16.6.3
+ react-scripts@2.1.1
+ react@16.6.3
added 1768 packages from 678 contributors and audited 35639 packages in 81.268s
found 0 vulnerabilities


Initialized a git repository.

Success! Created my-app at /Users/macbookpro/my-app
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 my-app
  npm start

So, how do I safely terminate this, and then turn it back on? Or does it need to stay running, and if it's terminated, need to be reinstalled with the "npx create-react app" command?

I guess I'm just wondering how to access "that directory."

I understand it's probably a super basic question, but it would help me get a grip on managing my react app.

Thank you!!

Artem
  • 33
  • 5

3 Answers3

2

terminate and turn it back on

You can terminate the project with CTRL + C or CTRL + Z.And after the termination, you can feel free to restart it. Assuming your project runs at port 3000,if you terminal your project, you won't be able to get your project in the browser.

If you want to get your project like in http://localhost:3000, you need to make the project stay running.

npx command

There is no need to "npx create-react app" again. "npx create-react-app my-app" command will install create-react-app command globally but momentarily, it was only needed when initial project.

access "that directory"

I think the message you post above has told you.

We suggest that you begin by typing:

 cd my-app

 npm start
Root
  • 2,301
  • 1
  • 10
  • 14
0

If you choose npm start the watcher will be continuosly running for development process.. you can stop it pressing CTRL + C twice on terminal.

npm run build runs once and stops alone generating files for production (compiled, minified).

Walter Cejas
  • 1,924
  • 1
  • 12
  • 22
0

Actually after installation completed, you don't need to terminate it.

To enter the project directory, simply type cd my-app

Then to start the development server type npm start it will take few seconds to bring you to the browser (my-app project opened).

You may like to see the address bar of the browser to know the running port of development server.

When you need to stop the server just press ctrl + c

If you forget the project directory's location in mac, you can find by mdfind kind:folder "my-app"

Optional: If you use Visual Studio Code then you can type code . being inside the project directory to open up the full project directory with VS Code.

perfectionist1
  • 857
  • 2
  • 11
  • 14