angular-cli: Deleteing node_modules causes "You seem to not be depending on "@angular/core"."

- [x] feature request
ng -v
@angular/cli: 1.0.6
node: 6.10.3
os: win32 x64
@angular/common: error
@angular/compiler: error
@angular/core: error
@angular/forms: error
@angular/http: error
@angular/platform-browser: error
@angular/platform-browser-dynamic: error
@angular/router: error
@angular/cli: error
@angular/compiler-cli: error

Repro steps.

  1. install npm
  2. yarn global add @angular/cli@1.0.6 or npm install -g @angular/cli@1.0.6 (both produce the same)
  3. ng new myproj
  4. ng serve - works
  5. check-in to your source-control all the project files except for node_modules directory 5.1. one can simply run move node_modules node_modules2 instead of steps 5+6
  6. go to a different computer and run steps 1+2. then, fetch the project from the source-control.
  7. ng b -> produces: You seem to not be depending on "@angular/core". This is an error. ng serve -> produces:
The "@angular/compiler-cli" package was not properly installed.
Error: The "@angular/compiler-cli" package was not properly installed.

Only yarn add or npm install will resolve this, which is somewhat unexpected (I am in the Angular CLI realm now, trying to build, why won’t it solve my dependencies itself?)

Desired functionality.

I expected the angular-cli to successfully build the project and download all the dependencies.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 4
  • Comments: 16 (3 by maintainers)

Most upvoted comments

lo solucione con: -> npm link -> ng serve y listo

solution: ->npm install ->ng serve

@EekoS It’s the desired behavior you must install the node modules before you run the project. It’s not specific to @angular dependencies as there might be other dependencies needs to be resolved before running the project.