npm install [package] 删除包 [英] npm install [package] removing packages

查看:152
本文介绍了npm install [package] 删除包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

npm install [package] 命令正在删除其他软件包,我必须运行 'npm install' 命令来重新安装它们,这是一项繁琐的任务.

npm install [package] command is removing other packages and I have to run 'npm install' command to reinstall them which is a tedious task.

所有包都记录在 package.json 和 package-lock.json 文件中.

All packages are recorded in the package.json and package-lock.json files.

如果我 npm install [package b],它会安装包 b 但删除包 a.对于其他包,反之亦然.

If I npm install [package b], it will install package b but remove package a. This occurs vice versa with other packages.

我总是必须运行npm install"来返回所有已删除的包,以便现在包 a 和 b"按预期存在于 node_modules 中.

I always have to run 'npm install' to return all removed packages so that now 'packages a and b' exist in the node_modules as intended.

这是添加包的正常程序吗?或者有什么方法可以避免在添加新包后使用npm intall"?

Is this normal procedure for adding packages? Or is there a way I can avoid using 'npm intall' after adding a new package?

推荐答案

NPM 5.7 中有一个修剪错误,这个问题发布后不久就解决了.

There was a pruning bug in NPM 5.7 which was resolved not long after this question was posted.

https://github.com/npm/npm/issues/17379

它显然从 5.7.1 开始解决.

It's apparently resolved as of 5.7.1.

这篇关于npm install [package] 删除包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆