解决 npm Usage of the --dev option is deprecated. Use --only=dev instead.
问题:
你想使用以下命令为 NodeJS 包安装开发依赖
npm_install_deprecated.sh
npm install --dev但你收到此错误消息:
npm_warn.txt
npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.解决方案
你可以使用
npm_install.sh
npm install # 安装正常(非开发)依赖
npm install --only=dev # 仅安装开发依赖代替。注意 npm install --only=dev 仅安装开发依赖,因此在大多数情况下你想运行两个命令。
Check out similar posts by category:
NodeJS
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow