node.js - angular-cli:为什么当 npm 安装新模块时,旧模块会被删除

标签 node.js angular npm angular-cli node-modules

我的应用程序有 ng-sidebar 模块,但是当我安装 ng2-d&d 这样的新模块时:

npm install ng2-dnd --save

旧模块从应用程序模块中删除并发生以下错误:

Cannot find module ng-sidebar.

我试图在 Node 模块中找到 ng-sidebar,但我没有找到它。我安装了 ng-sidebar。

npm install ng-sidebar --save

但是我安装的最后一个模块从 node-module 中丢失了。

最佳答案

首先我删除package-lock.json,然后我转到根目录,在命令中写入npm update,现在它正在工作

关于node.js - angular-cli:为什么当 npm 安装新模块时,旧模块会被删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48594208/

相关文章:

node.js - 比较并添加嵌套数组内的两个数组

node.js - 环回中日期和时间的数据类型是什么

npm - 带有browserify的多个 bundle ,在外部使用模块

npm搜索需要很长时间

javascript - 由于 node.js 延迟响应导致连接超时

javascript - nodejs中的Redis缓存

javascript - setAttribute 使属性名称小写

animation - Angular 2 : Delete element from the list animation

Angular - formGroupName 值更改不会更新表单

javascript - CSV 解析器文档