Proposal: detect the absence of the `node_modules` folder while running `ng build` or `ng serve`
See original GitHub issue🚀 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
.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
ng serve build error after npm install - node.js - Stack Overflow
I'm getting the following error in my angular2 app with cmd ng serve after deleting the node_modules directory and building it new with...
Read more >cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >Workspace npm dependencies - Angular
The CLI command ng new creates a package.json file when it creates the new workspace. This package.json is used by all projects in...
Read more >JavaScript Best Practices and node_modules - Julie Ng
The JavaScript ecosystem and how it stores modules locally in the project can be frickle. Especially when coming from another language, ...
Read more >A Step-by-Step Tutorial for Your First AngularJS App - Toptal
In this AngularJS tutorial, you will learn how to build an Angular app from start ... The ng-repeat directive is one of the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Instead of showing a message, how if we automatically do
npm install
oryarn install
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.