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
?
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.
如果要避免创建node_modules目录,可以通过npm install -g create-react-app
全局npm install -g create-react-app
。
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.
基本上是包含您的应用程序所需的所有节点程序包的文件夹,nmp install create-react-app依赖于将安装在node_modules文件夹中的其他节点程序包。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.