1

I'm trying to run an existing project, but I'm stuck at install phase. npm install gives me the following error:

npm ERR! path C:\Users\~\Source\node_modules\firebase\node_modules\grpc
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c ./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library
npm ERR! '.' is not recognized as an internal or external command,
npm ERR! operable program or batch file.

What could be causing the problem?

I already tried the following commands/workarounds, but this gives me the same error:

npm install --build-from-source @grpc/grpc-js

npm install --build-from-resources

deleting package-lock.json

1 Answers1

0

The problem is with incompatible versions of node and npm between global instalation and your project angular version. To repair it, first you have to download and install nvm from here. Then you type nvm install v8.11.3 and nvm use v8.11.3. After that you have to downgrade npm by typing npm i npm@6.3.0 -g. Now you can install node modules by typing npm i

But this is not over :) You can't run the project by ng serve, because your node and npm version is mismatched with global @angular/cli version. So you have to revert to newest node by typing nvm use 14.15.1 (if 14.15.1 is your version of node) What about npm? It won't upgrade via npm i npm@latest -g, you have to use this workaround. After that you may have to install angular globally once again by typing npm install -g @angular/cli@latest and if you did that all and prayed enough, maybe it will work...

tomekszy
  • 11
  • 1