Which folder should I run 'npm install' from? (Example) (2024)

Which folder should I run 'npm install' from? (Example) (1)

katinkahesselink

2,392 Points

Posted by katinkahesselink

katinkahesselink

2,392 Points

I'm unclear which folder I should run 'npm install' from - and the same for 'npm start'.

[This question belongs in the 'learn react' track, on the 'react by example' 'setting up the project' video where there is example code we can download. I am not sure why the question doesn't end up there.]

5 Answers

Which folder should I run 'npm install' from? (Example) (2)

Jaroslaw Adamowicz

11,634 Points

Hi,

what operating system do you use?

In Linux or Mac OS you can use:

which npm

This will tell you where your npm program is located and also ensure it is globaly recognized.If it doesn't work it might be not installed.

You can also try in console (cmd in Windows, terminal in Mac OS):

npm

This should return you something (besides 'not recognize command' or 'command not found').:)

As for folder I'm not sure if this command takes into consideration your current directory, but if yes just prepare your own folders for it.

Let say you are on D:\ in Windows or Documents in Mac OS, just create something like this:

D:\My_tools\javascript\npm\

or something similar like:

CODE/javascript/tools/npm 

and punch it there!

Just try to remember to name it properly so in future you would now where to look if needed :)

I'm not sure if this helped you somehow, if not please let me know in more detail what you need!

BR,

Jarek

Which folder should I run 'npm install' from? (Example) (3)

stjarnan

Front End Web Development Techdegree Graduate 56,488 Points

stjarnan

stjarnan

Front End Web Development Techdegree Graduate 56,488 Points

Hi Katinka,

You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.

Hope that helps,

Jonas

Which folder should I run 'npm install' from? (Example) (4)

katinkahesselink

2,392 Points

katinkahesselink

katinkahesselink

2,392 Points

Thanks. I am on Ubuntu and am trying the 'create react-app' tutorial.

I think the answer to my question is as follows.

There are two options:1) Go to the directory where you want your RSVP project and run 'create-react-app app-name'. This will create a basic react app. From the downloads you need the 'RSVP assets' and 'RSVP starter files' folders.

run npm install and npm start from the folder that 'create-react-app' creates.

2) to start up the files that the tutorial creates and run them in the terminal and browser, just do 'npm install' and 'npm start' in the 1-Setting-up-with-Create-React-App/2-Setting up the Project/final-project folder.

Which folder should I run 'npm install' from? (Example) (6)

Ari Misha

19,323 Points

Ari Misha
Ari Misha

19,323 Points

Hiya there! You just need to down the .zip file provided by the Teacher in the down sections in your desired location. I prefer all my project files in ~(tilda) location. Extract 'em files in the folder. And cd into the folder where your package.json exists and run npm install and start the dev server. Happy Coding!

~ Ari

Posting to the forum is only allowed for members with active accounts.
Please sign in or sign up to post.

Which folder should I run 'npm install' from? (Example) (2024)

FAQs

Which folder should I run 'npm install' from? (Example)? ›

You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.

Which folder should I run npm install? ›

On most systems, this is /usr/local . On Windows, it's %AppData%\npm . On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe . When the global flag is set, npm installs things into this prefix.

Where to perform npm install? ›

npm install (in package directory, no arguments): Install the dependencies in the local node_modules folder. In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) as a global package.

Does it matter where you install npm? ›

As a best practice, you should change the default installation location from a system directory to a user directory. If you'd like to learn to do this, take a peek at the seventh tip in our npm tricks article!

What is the best way to run npm install for nested folders? ›

If you want to run a single command to install npm packages in nested subfolders, you can run a script via npm and main package. json in your root directory. The script will visit every subdirectory and run npm install.

Where are npm installs located? ›

Windows: Packages are installed in %APPDATA%\npm\node_modules . macOS and Linux: Packages are typically installed in /usr/local/lib/node_modules or a user-specific directory like ~/.

Where does npm run from? ›

Scripts are run from the root of the module, regardless of what your current working directory is when you call npm run . If you want your script to use different behavior based on what subdirectory you're in, you can use the INIT_CWD environment variable, which holds the full path you were in when you ran npm run .

Where to start npm? ›

First, create a new Node. js project or navigate to your existing project directory and initialize it with npm init . This command will prompt you to enter various details about your project, including the name, version, description, entry point, and more. For the entry point, you typically specify index.

Where should the node be installed? ›

Windows normally recommends that the programs be installed in the Program Files folder, in a folder of their own (in our case, we are installing Node. js, so the nodejs folder is our go-to place).

How to find the path of npm? ›

locate-path
  1. Install. $ npm install locate-path.
  2. Usage. Here we find the first file that exists on disk, in array order. ...
  3. API. locatePath(paths, options?) ...
  4. Related. path-exists - Check if a path exists.
Feb 9, 2023

What is the best way to install npm node? ›

We strongly recommend using a Node version manager like nvm to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.

Is it safe to run npm install? ›

I have seen questions since the folks at npm added an automatic scan for vulnerabilities after every npm install. In my opinion you shouldn't be alarmed.

Why is npm install not working? ›

Understanding npm install errors

These errors can arise due to different reasons like incorrect permissions, missing dependencies, network issues, or conflicts in package versions. Resolving these errors is crucial for the successful installation and functioning of your project.

Which folder do you run npm install? ›

You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.

How do I run npm in a specific folder? ›

  1. npm. To run an npm script from another directory, use --prefix: npm --prefix <path> run <command>
  2. yarn. To run a yarn script from another directory, use --cwd: yarn --cwd <path> <command>
  3. Example. If you have a package.json in the example directory: { "scripts": { "start": "echo hello world" } }

How to locally install npm packages? ›

Installing npm packages locally
  1. Installing. A package can be downloaded with the command npm install <package name> . For example: ...
  2. Using the installed package. Once the package is in node_modules, you can use it in your code. ...
  3. Using the --save flag with package. json. ...
  4. Manually adding dependencies to package. json.

Where to run npm install in visual studio? ›

js projects, the easiest way to install npm packages is through the npm package installation window. To access this window, right-click the npm node in the project and select Install New npm Packages. In this window you can search for a package, specify options, and install.

Top Articles
Bank Of Montreal Stock Ownership - Who Owns Bank Of Montreal in 2024?
Axis Credit Card Application Status Online - Know How to Track
Po Box 7250 Sioux Falls Sd
The Largest Banks - ​​How to Transfer Money With Only Card Number and CVV (2024)
Tesla Supercharger La Crosse Photos
Kokichi's Day At The Zoo
Kansas Craigslist Free Stuff
Shorthand: The Write Way to Speed Up Communication
Obituary (Binghamton Press & Sun-Bulletin): Tully Area Historical Society
Best Theia Builds (Talent | Skill Order | Pairing + Pets) In Call of Dragons - AllClash
Acbl Homeport
123 Movies Babylon
Mercy MyPay (Online Pay Stubs) / mercy-mypay-online-pay-stubs.pdf / PDF4PRO
Azeroth Pilot Reloaded - Addons - World of Warcraft
Springfield Mo Craiglist
Love In The Air Ep 9 Eng Sub Dailymotion
Midlife Crisis F95Zone
065106619
Craftology East Peoria Il
Eva Mastromatteo Erie Pa
Palm Coast Permits Online
Bj Alex Mangabuddy
Best Nail Salons Open Near Me
Governor Brown Signs Legislation Supporting California Legislative Women's Caucus Priorities
What Is The Lineup For Nascar Race Today
Jordan Poyer Wiki
Prot Pally Wrath Pre Patch
Walmart Pharmacy Near Me Open
Beaufort 72 Hour
Bleacher Report Philadelphia Flyers
4Oxfun
JVID Rina sauce set1
Marokko houdt honderden mensen tegen die illegaal grens met Spaanse stad Ceuta wilden oversteken
Ou Football Brainiacs
Miles City Montana Craigslist
Angel Haynes Dropbox
Publix Christmas Dinner 2022
Mini-Mental State Examination (MMSE) – Strokengine
Motor Mounts
Kamzz Llc
4083519708
Second Chance Apartments, 2nd Chance Apartments Locators for Bad Credit
Kutty Movie Net
6576771660
Port Huron Newspaper
Devotion Showtimes Near Showplace Icon At Valley Fair
Headlining Hip Hopper Crossword Clue
552 Bus Schedule To Atlantic City
Germany’s intensely private and immensely wealthy Reimann family
Roller Znen ZN50QT-E
Sam's Club Fountain Valley Gas Prices
Latest Posts
Article information

Author: Maia Crooks Jr

Last Updated:

Views: 6428

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Maia Crooks Jr

Birthday: 1997-09-21

Address: 93119 Joseph Street, Peggyfurt, NC 11582

Phone: +2983088926881

Job: Principal Design Liaison

Hobby: Web surfing, Skiing, role-playing games, Sketching, Polo, Sewing, Genealogy

Introduction: My name is Maia Crooks Jr, I am a homely, joyous, shiny, successful, hilarious, thoughtful, joyous person who loves writing and wants to share my knowledge and understanding with you.