angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.76k stars 11.98k forks source link

Feature Request: Add option to disable 'Unable to find "@angular/cli" in devDependencies' warning #9721

Closed admosity closed 4 years ago

admosity commented 6 years ago

Versions

Unable to find "@angular/cli" in devDependencies.

Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"

Angular CLI: 1.7.0
Node: 8.7.0
OS: darwin x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.0
@angular-devkit/build-optimizer: 0.3.1
@angular-devkit/core: 0.3.1
@angular-devkit/schematics: 0.3.1
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.0
@schematics/angular: 0.3.1
@schematics/package-update: 0.3.1
typescript: 2.5.3
webpack: 3.11.0

Use case

We're managing several angular cli based setups. For maintaining these we've created a meta package that has @angular/cli as a dependency and several other packages that our projects are dependent on. For maintenance we're centralizing our updates in the meta package so the project owner does not need to worry about these maintenance items and this lowers our cost of maintenance on multiple projects.

Sample meta package dependencies:

    "@angular/animations": "^5.2.0",
    "@angular/cli": "~1.7.0",
    "@angular/common": "^5.2.0",
    "@angular/compiler": "^5.2.0",
    "@angular/compiler-cli": "^5.2.0",
    "@angular/core": "^5.2.0",
    "@angular/forms": "^5.2.0",
    "@angular/http": "^5.2.0",
    "@angular/language-service": "^5.2.0",
    "@angular/platform-browser": "^5.2.0",
    "@angular/platform-browser-dynamic": "^5.2.0",
    "@angular/router": "^5.2.0",
    "@angularclass/hmr": "^2.1.3",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "classlist.js": "^1.1.20150312",
    "codelyzer": "^4.0.1",
    "console-polyfill": "^0.3.0",
    "core-js": "^2.4.1",
    "cz-conventional-changelog": "^1.2.0",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "rxjs": "^5.5.6",
    "standard-changelog": "~1.0.7",
    "svgxuse": "^1.2.6",
    "ts-node": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.5.3",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.19"

Sample project dependencies:

  "dependencies": {
    "@ngrx/effects": "^5.1.0",
    "@ngrx/entity": "^5.1.0",
    "@ngrx/router-store": "^5.0.1",
    "@ngrx/store": "^5.1.0",
    "meta-package": "git+ssh://git@bitbucket.org/some-git/repo.git"
  },
  "devDependencies": {
    "@ngrx/schematics": "^5.1.0",
    "@ngrx/store-devtools": "^5.1.0",
    "karma": "~2.0.0",
    "ngrx-store-freeze": "^0.2.1"
  }

Observed behavior

Running any command produces the below, but otherwise runs fine:

Unable to find "@angular/cli" in devDependencies.

Please take the following steps to avoid issues:
"npm install --save-dev @angular/cli@latest"

Desired behavior

A way to hide this message.

clydin commented 6 years ago

Something else to consider with the use of the package is that package hoisting is not guaranteed so the configuration may actually cause the project to use the global version and not the version within the meta-package. This could cause issue with the other dependencies as well.

admosity commented 6 years ago

Yeah, I ran through some use cases against this. It seems for the most part the consuming project's dependencies take priority. We do have some edge cases where we needed to pull out a dependency, but for the most part has been okay. We have control across the board so it's okay for us to make this move.

alan-agius4 commented 4 years ago

Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.

If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.

angular-automatic-lock-bot[bot] commented 4 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.