sander
sander

Reputation: 1654

What for is the node_modules folder that is created by running npm install create-react-app for?

When I run npm install create-react-app in any folder, it creates a node_modules folder. What is the node_modules folder for? How is it related to create-react-app?

Upvotes: 2

Views: 2012

Answers (4)

kawamurakazushi
kawamurakazushi

Reputation: 96

You can install globally by npm install -g create-react-app if you want to avoid creating node_modules directory.

Upvotes: 1

Basically is the folder that contains all the node packages that your app requires, nmp install create-react-app depends on other node packages that will be installed in the node_modules folder.

Upvotes: 0

Eric Schoonover
Eric Schoonover

Reputation: 48402

create-react-app should be installed using npm install -g create-react-app that will make the create-react-app command available in any directory.

See the npm documentation for a complete description of the various folders that npm creates or writes to.

Whe you run npm install create-react-app (without the global (-g) modifier) npm executes a local dependency install and puts the results in ./node_modules of the current directory.

Upvotes: 3

klugjo
klugjo

Reputation: 20885

Short answer: yes.

Long answer: create-react-app should be installed globally, then run inside the folder in which you wish to put your app.

Upvotes: 0

Related Questions