i'm getting this error fairly often when working ...
# contribute
w
i'm getting this error fairly often when working with a pulumi branch:
Copy code
Failed to load gRPC binary module because it was not installed for the current system
    Expected directory: node-v79-darwin-x64-unknown
    Found: [node-v72-darwin-x64-unknown]
    This problem can often be fixed by running "npm rebuild" on the current system
    Original error: Cannot find module '/opt/pulumi/node_modules/@pulumi/pulumi/node_modules/grpc/src/node/extension_binary/node-v79-darwin-x64-unknown/grpc_node.node' from 'grpc_extension.js'
cd /opt/pulumi/node_modules/@pulumi/pulumi && npm rebuild
seems to fix it, but mildly annoying.
w
That suggests you are changing node versions between when you “NPM install” and when you run “Pulumi up”. If you ensure you run the same node version for both, you should never see this. That said, we are hoping to get rid of the native code dependency which leads to this whole class of problems as part of 2.0 in a couple months.
w
this is when i run unit tests, and i'm not switching node versions (that i know of). i am using nvm to manage node in general which might be at odds with the
make
script in the pulumi nodejs sdk which may rely on brew-installed node. i don't use brew installed node, but it was installed per the pulumi contributor instructions as a dependency of yarn (which we also don't normally use).
w
Yeah - somehow you are ending up using two different
node
versions here.
i don't use brew installed node, but it was installed per the pulumi contributor instructions as a dependency of yarn
I see - that is likely part of the root cause here. I don't off the top of my head know how best to address this - but it would be unique to trying to build locally and use a different node version than the local build for your development.
w
It's not a big deal to continue with
npm rebuild
if this is going to be holistically addressed as part of 2.0. Thanks for the info.