[英]create-react-app eslint issue due to higher level folder containing another app with node_modules in it
[英]What for is the node_modules folder that is created by running npm install create-react-app for?
当我在任何文件夹中运行npm install create-react-app
时,它将创建一个node_modules
文件夹。 node_modules
文件夹有什么用? 它与create-react-app
什么关系?
create-react-app
应使用安装npm install -g create-react-app
,这将使create-react-app
的任何目录中可用的命令。
有关npm
创建或写入的各种文件夹的完整说明,请参见npm文档 。
运行npm install create-react-app
(不带全局( -g
)修饰符)时,npm执行本地依赖项安装,并将结果./node_modules
当前目录的./node_modules
中。
如果要避免创建node_modules目录,可以通过npm install -g create-react-app
全局npm install -g create-react-app
。
简短的回答:是的。
长答案: create-react-app
应该在全局安装,然后在要放置应用程序的文件夹中运行。
基本上是包含您的应用程序所需的所有节点程序包的文件夹,nmp install create-react-app依赖于将安装在node_modules文件夹中的其他节点程序包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.