question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sahilpuravcommented, Aug 16, 2020

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

0reactions
angular-automatic-lock-bot[bot]commented, Jul 25, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found