NPM: npm init is not creating a node_modules folder
I downloaded a GH repo, a react app, which did not include the node_modules folder, but already had a package.json with react scripts, "start" script for ex.
Navigating to the project folder in terminal, I reach it, and then do an npm init to initialize, and I was expecting a node_modules folder to appear.
I then go to start the React script with npm run start but it's telling me the command
6 Replies
has nothing to do with React just so yo know
also node_modules should never be uploaded in your git
should be part of gitignore always
you woul dwant to use
npm i
to install from package.json
then you can use the other script commands.so i need to run an npm install?
yes
that installs deps found listed in the package.json
gootcha okay, I assumed npm init would've done that okay
its working nwo, thank you
init stands for initialize. You would only use that when you wanted to make a package.json before installing deps 🤷♂️ (like for new projects with nothing yet)
honestly I've never use that command xD
init
doesn't install anything ever, you still have to add packages either by using npm install packagename
or editing package.json
manually and running npm install