本地安装(npm install)时,我可以让 npm 使用我的全局包吗?
当我运行 npm install .
时,需要一段时间来构建包含 c 代码(如expresso)的包(这取决于node-jscoverage)。我意识到我可以在运行 npm install 之前将 expresso 从全局包目录 (~/Developer/lib/node_modules/expresso) 复制到当前目录中的 ./node_modules/expresso 。麻烦编译一下。有没有办法告诉 npm 在获取和构建包之前尝试从我的全局 npm 目录安装包?
When I run npm install .
it takes a while to build packages that contain c code like expresso (which depends on node-jscoverage). I realized that I can copy expresso from my global package directory (~/Developer/lib/node_modules/expresso) to ./node_modules/expresso in my current directory before running npm install .
and it won't bother compiling it. Is there a way to tell npm to try to install packages from my global npm directory before fetching and building them?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想这个命令可能会有所帮助: npm 链接
看看这个:npm 从本地位置而不是从网络安装软件包?
I guess this command might help: npm link
Check out this: npm to install packages from local position rather than from web?