Skip to content

Proposal: detect the absence of the node_modules folder while running ng build or ng serve #18393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
AndrewKushnir opened this issue Jul 28, 2020 · 5 comments
Closed
2 tasks done
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient type: bug/fix
Milestone

Comments

@AndrewKushnir
Copy link

🚀 Feature request

Command

  • build
  • serve

Description

Running ng build or ng serve in a folder without node_modules present results in the following error thrown in terminal:

$ ng serve
An unhandled exception occurred: Cannot find module '@angular-devkit/build-angular/package.json'
Require stack:
... stacktrace ...
See "/private/var/folders/7d/r6b3nrdj7bn9t_w_dclm6y9r00kg80/T/ng-PRpMHw/angular-errors.log" for further details.

This can happen for example after downloading an example app from angular.io website. Example link:

https://angular.io/generated/zips/form-validation/form-validation.zip

Describe the solution you'd like

The proposal is to handle the case when node_modules folder is not present and output a user-friendly error message that would suggest to run npm install or yarn install.

@alan-agius4 alan-agius4 added area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient type: bug/fix labels Jul 29, 2020
@ngbot ngbot bot modified the milestone: Backlog Jul 29, 2020
@sahilpurav
Copy link

Instead of showing a message, how if we automatically do npm install or yarn install

@helloankit
Copy link

Such errors seems to be mind-boggling when I was very new to Angular.
These needs to be exact and clear to the end user.

@elvisbegovic
Copy link
Contributor

Same with ng new ap --skip-install && cd ap && ng version

This is somehow related to #10474

@alan-agius4
Copy link
Collaborator

Duplicate of #10536

@alan-agius4 alan-agius4 marked this as a duplicate of #10536 Jun 24, 2021
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: @angular/cli freq1: low Only reported by a handful of users who observe it rarely severity2: inconvenient type: bug/fix
Projects
None yet
Development

No branches or pull requests

5 participants