package.json 中存在devDependencies和dependencies,那么他们的区别是什么呢?
devDependencies是开发中需要安装的包
dependencies是发布时需要安装的包
那么如果区分安装呢?
默认用 npm install 的时候他会安装devDependencies中的内容
如果用 npm install --production 就会安装dependencies中的内容
If you do npm config set production
, then that sets the --production
configuration flag for all npm commands, by setting production = true
in the ~/.npmrc file.
If you do npm start --production
, then it‘ll set the NODE_ENV=production
environ for the start script.
If you do npm install --production
then it won‘t install devDependencies locally.
时间: 2024-12-12 15:24:47