node.js - npm-install 不安装子依赖项

标签 node.js angular npm

我正在开发一个 Angular 4 项目。我创建了一个具有某些依赖项的项目。该项目本身运行良好。

现在我想在另一个项目中使用这个项目。我将前一个项目添加到后者的 package.json (在依赖项下)。

现在,当我运行 npm install 时,该包已安装,但其依赖项并未安装,我必须手动安装它们才能使我的项目正常运行。

谁能告诉我为什么会这样?我在实现过程中是否有任何错误?

代码:

ui-common package.json

"dependencies": {
    "@angular/cdk": "^2.0.0-beta.11",
    "@angular/common": "^4.4.6",
    "@angular/compiler": "^4.4.6",
    "@angular/core": "^4.4.6",
    "@angular/forms": "^4.4.6",
    "@angular/http": "^4.4.6",
    "@angular/material": "^2.0.0-beta.11",
    "@angular/platform-browser": "^4.4.6",
    "@angular/platform-browser-dynamic": "^4.4.6",
    "@angular/router": "^4.4.6",
    "ag-grid": "^17.1.1",
    "ag-grid-angular": "^17.1.0",
    "angular-split": "=0.2.2",
    "angular-tree-component": "^7.0.2-beta1",
    "core-js": "=2.5.1",
    "draggabilly": "^2.2.0", // The one causing trouble
    "foundation-sites": "=6.3.1",
    "rxjs": "^5.5.2",
    "x2js": "^3.2.1",
    "zone.js": "=0.8.18"
  }

客户端应用程序包.json

  "dependencies": {
    "@angular/animations": "^4.3.1",
    "@angular/cdk": "^2.0.0-beta.11",
    "@angular/common": "=4.4.6",
    "@angular/compiler": "=4.4.6",
    "@angular/core": "=4.4.6",
    "@angular/forms": "=4.4.6",
    "@angular/http": "=4.4.6",
    "@angular/material": "^2.0.0-beta.11",
    "@angular/platform-browser": "=4.4.6",
    "@angular/platform-browser-dynamic": "=4.4.6",
    "@angular/router": "=4.4.6",
    "@goldsam/ng-golden-layout": "0.0.3",
    "@ngui/scrollable": "^0.9.1",
    "@ngui/utils": "^0.8.1",
    "ag-grid": "^16.0.1",
    "ag-grid-angular": "^16.0.0",
    "angular-tree-component": "=7.0.2-beta1",
    "core-js": "=2.5.1",
    "enhanced-resolve": "=3.4.1",
    "foundation-sites": "=6.3.1",
    "golden-layout": "^1.5.9",
    "intl": "=1.2.5",
    "mdn-polyfills": "=5.5.0",
    "morgan": "=1.9.0",
    "popper.js": "^1.12.9",
    "rxjs": "=5.5.2",
    "typescript-collections": "1.3.2",
    "ui-common": "1.0.0-beta.25", // package included here
    "zone.js": "=0.8.18"
  }

最佳答案

您是否尝试过执行 npm install --include 依赖项。也可能是因为您也可能运行旧版本,所以您需要这样做

npm install -v 2.0.0 

这应该在 Atom 项目文件夹中安装 gem 依赖项

关于node.js - npm-install 不安装子依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52160152/

相关文章:

node.js - 我应该为 express.cookieParser() secret 使用什么?

node.js - 使用 dropboxjs 通过 oauth 对客户端进行身份验证 2. 服务器端呢?

Angular 5缓存http服务api调用

node.js - 如何通过 Jenkins 运行 npm start 来启动应用程序

javascript - 403 使用 Cheerio 时禁止

javascript - 为什么在 Mongoose 模式中嵌套对象?

node.js - 如何使用experimental-specifier-resolution=node 运行node.js cli?

angular - 当我尝试从 Linux 中使用 ngserve 运行我的应用程序时,出现此错误 :Cannot find module '@angular-devkit/build-angular/package. json

angular - 错误: NG04002: Cannot match any routes in Child Routes

Javascript 库使用 require() 但我没有或没有使用 nodeJS?