[英]NPM install with different package.json
Can you have two different package.json files in same path?您可以在同一路径中有两个不同的 package.json 文件吗? (file names: package1.json and package2.json) (文件名:package1.json 和 package2.json)
If so, how can you run npm install referring different package.json files from same path?如果是这样,您如何运行npm 安装引用来自同一路径的不同 package.json 文件? Looking to execute one json file at a time.希望一次执行一个 json 文件。
FYI: newbee to NPM仅供参考:新蜜蜂到 NPM
This is not an ideal way to it.这不是一个理想的方法。 You should change the structure of your project.您应该更改项目的结构。
Nevertheless, one way to do this in *nix systems is然而,在 *nix 系统中执行此操作的一种方法是
cp package1.json package.json && npm install && rm -rf package.json
If you already have a package.json
file, then如果您已经有package.json
文件,那么
cp package.json temp.json && cp package1.json package.json && npm install && rm -rf package.json && cp temp.json package.json && rm -rf temp.json
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.