[英]How to install a particular package through package.json in node directory into a different directory?
here is sample package.json
file这是示例package.json
文件
dependencies {
"inversify": "^5.0.1"
}
I would like to install the package into different directory inversify_backup
under node_modules
.我想将软件包安装到inversify_backup
下的不同目录node_modules
。 Is there any option to do it有没有办法做到这一点
Is this your folder structure?这是你的文件夹结构吗?
Technically you could cd node_modules/inversify_backup
then run npm i <package-name>
.从技术上讲,您可以cd node_modules/inversify_backup
然后运行npm i <package-name>
。
Although your dependency install would be overwritten when running in production when the build job runs the npm install
command.尽管在构建作业运行npm install
命令时在生产中运行时,您的依赖项安装将被覆盖。
I would recommend forking the inversify repository and just including it in your code if you need to make changes to the library.如果您需要对库进行更改,我建议分叉 inversify 存储库并将其包含在您的代码中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.