Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

3.2K
Vistas
ENOENT: no such file or directory, lstat '/Users/Desktop/node_modules'

An unhandled exception occurred:

ENOENT: no such file or directory, lstat 
'/Users/Desktop/node_modules'
See "/private/var/folders/3p/l_k1wk8n76v3cfwnxk0blx000000gn/T/ng- 
DF5EZ7/angular-errors.log" for further details.

Whenever i am doing ng serve, this error occurs, Can anyone tell me what is the cause of error. stuck in this since long hours.

over 4 years ago · Santiago Trujillo
18 Respuestas
Responde la pregunta

0

I had the same error when I tried installing an old version of bootstrap and referenced it in the angular.json file. Meanwhile, the package was never installed because it doesn't exist anymore. Check the new command for installing a particular package and after doing npm i <package-name> check in node_modules if it's there.

And also, I changed my bootstrap path from

../node_modules/bootstrap/dist/css/bootstrap.css

to

node_modules/bootstrap/dist/css/bootstrap.css
over 4 years ago · Santiago Trujillo Denunciar

0

  1. Download manually bootstrap from https://www.npmjs.com/package/bootstrap .
  2. Copy and past the folder you download to /Users/Desktop/node_modules .
  3. In CMD, enter to your project folder you created by typing: CD yourProjectName .
  4. In CMD: ng serve.
  5. In your browser: http://localhost:4200/
over 4 years ago · Santiago Trujillo Denunciar

0

I had this problem, it was just:

  1. Works "styles": [ "node_modules/bootstrap/dist/css/bootstrap.min.css"

  2. Not works "styles": [ "../node_modules/bootstrap/dist/css/bootstrap.min.css"

over 4 years ago · Santiago Trujillo Denunciar

0

So to sum up what is the cause of the issue. Its that the node_modules is not being read well from the angular.json file

over 4 years ago · Santiago Trujillo Denunciar

0

You need to check with the path of bootstrap in angular.json inside architect then styles

over 4 years ago · Santiago Trujillo Denunciar

0

In my case i removed the "../node_modules/bootstrap/dist/css/bootstrap.min.css" from angular.json

over 4 years ago · Santiago Trujillo Denunciar

0

Solving the problems on angular.json then deleting package-lock.json solved my problem.

My problem was related to a deleted package @angular/material. Angular.json styles were still referencing that package, I deleted those lines. Then I deleted the package-lock.json and execute it.

over 4 years ago · Santiago Trujillo Denunciar

0

In my case, my problem was a misspelling issue in the directory URL inside Angular.json. So I corrected the error and the apps run perfectly afterwards.

Not working: (misspelled on "node_modules")

"styles": ["./node_moodules/font-awesome/css/font-awesome.css"]

Working:

"styles": ["./node_modules/font-awesome/css/font-awesome.css"]

try checking your url path in Angular.json, this probably the case, hopefully this helps!

over 4 years ago · Santiago Trujillo Denunciar

0

I had the same problem. But I found a Solution which works for me.

Try:

npm install --save bootstrap

and then add in angular.json at "styles":

"node_modules/bootstrap/dist/css/bootstrap.min.css"

run the Project (Watch if youre in the right folder you can check it with typing in terminal ls and and then you should see node_modules, src etc.)

ng serve

over 4 years ago · Santiago Trujillo Denunciar

0

I had this problem on a non-Angular project; here's what worked for me:

  1. update node and npm
  2. delete package-lock.json
  3. run npm install --package-lock-only
over 4 years ago · Santiago Trujillo Denunciar

0

As @Manuel Villadiego said, you must define your bootstrap path like below:

"node_modules/bootstrap/dist/css/bootstrap.min.css"

Or

"./node_modules/bootstrap/dist/css/bootstrap.min.css"

This error will happen when you start bootstrap path with ../ ,

"../node_modules/bootstrap/dist/css/bootstrap.min.css"

because you go back one folder and node_modules folder doesn't exist there.

over 4 years ago · Santiago Trujillo Denunciar

0

Usually, it happens when

package-lock.json

was created by another version of the node js (I'm using the latest LTS version).

Just remove it and try again, this is OK.

over 4 years ago · Santiago Trujillo Denunciar

0

if: npm install bootstrap then "./node_modules/bootstrap/dist/css/bootstrap.min.css"

if npm install --save bootstrap then "node_modules/bootstrap/dist/css/bootstrap.min.css"

over 4 years ago · Santiago Trujillo Denunciar

0

Step 1) npm install --save bootstrap

Step 2) and then add in angular.json at "styles": "./node_modules/bootstrap/dist/css/bootstrap.min.css",

Step 3) ng serve

Problem solved

image showing the solution

over 4 years ago · Santiago Trujillo Denunciar

0

I just had the same issue, I removed the followings from angular.json which I had just added and the issue is resolved.

          "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
          "src/styles/styles.scss",
          "src/styles/colors.scss"
over 4 years ago · Santiago Trujillo Denunciar

0

I was facing similar error:

 An unhandled exception occurred: ENOENT: no such file or directory, lstat 
'C:\User_Name\Angular\node_modules\bootstrap'
See "C:\Users\User_Name\AppData\Local\Temp\ng-MhR1Ls\angular-errors.log" for further details.

This was caused due to adding this in styles array:

    "styles": [
          "src/styles.css",
          "../node_modules/bootstrap/dist/css/bootstrap.min.css"
        ]

Solved it by changing styles array with

    "styles": [
          "src/styles.css",
          "node_modules/bootstrap/dist/css/bootstrap.min.css"
        ]

This may have happened cause I made another angular project inside the parent folder or directory since "." denotes the home directory. This is just my understanding and the solution of the issue.

Please check whether you have added your current component.html file i.e. unique selector in your app.component.html file

Recently started my angular journey so cheers!!

over 4 years ago · Santiago Trujillo Denunciar

0

I removed the file from angular.json and added it to style.css.

@import '../node_modules/ngx-bootstrap/datepicker/bs-datepicker.css'
over 4 years ago · Santiago Trujillo Denunciar

0

Just do:

npm install --force and then npm audit fix --force

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda