154

I'm trying to build and serve my project. It was working properly, I updated it from git and then suddenly when I serve it, there is an Error saying "Another process, with id 29800, is currently running ngcc." I retried "npm i", also restarted the IDE and even pc, but it still says the same.

hadimbj
  • 1,697
  • 2
  • 8
  • 12

11 Answers11

336

This happens when ngcc (Angular compatibility compiler) is not finished doing what it does, you must have enabled ivy in your Angular project. read here for more info about ivy.

  1. First try to run npm install again, to see if it fixes your problem.
  2. Try to run ngcc manually.
  3. remove this file node_modules/@angular/compiler-cli/ngcc/__ngcc_lock_file__
  4. If none of the above worked, then remove node_modules directory and try npm i again.
Raphaël Balet
  • 6,334
  • 6
  • 41
  • 78
azerafati
  • 18,215
  • 7
  • 67
  • 72
33

My Laptop Crashed and I got this problem after restart. Removing the below file from ionic project solved the problem:

node_modules/@angular/compiler-cli/ngcc/ngcc_lock_file

The file name may have some leading or trailing underscores in various Angular versions.

starball
  • 20,030
  • 7
  • 43
  • 238
Lalit Rane
  • 850
  • 10
  • 16
10

Fix this all in one easy command:

run npm ci

this will delete node_modules and npm install

Ben Yee
  • 1,547
  • 13
  • 19
7

just remove the node_modulesthen run npm i

3

This happens when ngcc (Angular compatibility compiler) is not finished doing what it does

In Angular 15 of lock file is changed. To release the lock, execute in project folder

rm node_modules/.ngcc_lock_file
pvolyntsev
  • 141
  • 8
  • 1
    I think you could convince more users of the helpfulness of your contribution if you would spend some words on explanation. Try for [answer]. – Yunnosch Mar 06 '23 at 14:10
2

I deleted the file node_modules/@angular/compiler-cli/ngcc/ngcc_lock_file_ from the node_modules folder and its working fine.

aalbagarcia
  • 1,019
  • 7
  • 20
Manoj Tyagi
  • 169
  • 2
  • 3
1

simply run rm -rf node_modules && npm install

Vinicius Cardoso
  • 666
  • 8
  • 23
0

deleting lock file in nodes module at the following location will fix this errors

*C:\Users\OneDrive\Desktop\app\node_modules\@angular\compiler-cli\ngcc\src\locking*

delete the lock-file javascript file over there.

if it still shows the same error then delete the entire lock-files folder ,restart command prompt and then it will run

0

Also if above solutions, dosen´t work it could be that the pipeline has too little space to work with side processes. What you could do is go to angular.json and search for this object:

"budgets": [{"type": "initial","maximumWarning": "4mb","maximumError": "5mb"}]

and raise the limits on maximumError for example.

More about budgets here: angular.io/guide

Michael R
  • 75
  • 12
0

Had the same issue running angular with a docker file, and like suggested here I deleted ngcc_lock_file BEFORE running npm install

enter image description here

-2

Just run

ionic repair

And select Yes