2

I have issue about missmatch node version for requirement load gRPC. This issue appear when i run node js server using pm2, but when i did it using nodemon and node command, it running well

Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v88-darwin-x64-unknown
Found: [node-v64-darwin-x64-unknown]

i have already change my node version default to same as project, using:

nvm alias default x.x.x

but the result same,

Also i have already rm -rf node_modules and run npm install again, but the result is same,

Last, i have already doing npm rebuild and the result same error.

What want i know is, how we can solve this issue whatever missmatch version? Why i already doing change default node version in global using nvm, but it still look like not change for project, look like it have some other settings/configuration that i did not done

rusli Abdul gani
  • 145
  • 1
  • 1
  • 7

1 Answers1

2

The problem is that grpc is installed for Node 10, but you are trying to use it in Node 16. You can explicitly install it for Node 16 by running

npm install --target=16.0.0

Please note that the grpc package is deprecated with the recommendation that you use @grpc/grpc-js instead.

murgatroid99
  • 19,007
  • 10
  • 60
  • 95