Closed aybhalala closed 3 years ago
Hmm... Given that your node interpreter is in /usr/local/bin/node, I don't recognize this path. Can you tell us how you installed your node interpreter on your machine?
Oh I see, you installed the package from the website. Let's see...
So there is something odd with your setup. You've installed from the .pkg
file available on the nodejs website, meaning the installer installed your interpreter in /usr/local/bin/node
. Picking up my macos machine, and installing nodejs using this method, I can proper install grpc using npm install grpc
, however, if I try to do npm install -g grpc
, I get a permission error because it tries to install it globally in /usr/local
, which is the default. Yet in your report, it is installing it in /Users/adi/.npm-global
, so I am guessing you've altered your environment somehow.
What's the value of your NODE_PATH
environment variable? Is there any other variables you have in your environment related to your nodejs setup?
Hey @nicolasnoble , I tried installing without the -g flag in a local project directory and have the exact same error. The NODE_PATH was not set, I tried installing after setting it, but still the same errors.
I just tried a bit locally, and in order to achieve a proper global installation without being root, I had to do the following:
$ mkdir ~/.npm-glolbal
$ npm config set prefix ~/.npm-global
After this, doing npm install -g grpc
successfully installed the module in my home folder, still without issues.
I'm thinking there's something else in your environment / setup that is causing this, but I don't know what. The smoking gun is this line in the report:
1729 silly lifecycle grpc@1.17.0-pre1~install: Args: [ '-c',
1729 silly lifecycle 'node-pre-gyp install --fallback-to-build --library=static_library' ]
1730 silly lifecycle grpc@1.17.0-pre1~install: Returned: code: 1 signal: null
1731 info lifecycle grpc@1.17.0-pre1~install: Failed to exec install script
Meaning that npm tried to run our installation script, but failed to do so, with an unhelpful error code. I know we've recently changed this line here: https://github.com/grpc/grpc-node/pull/466
Meaning this change went into grpc 1.14. Could you try installing grpc@1.13 in your environment to see if it fails too?
I already had the ~/.npm-global set I tried 1.13 version and had the same error. I am currently behind a corp proxy so maybe that might have some implications. Will try to catch up with seniors to see if something can be done.
Okay. I really don't think this is network-related, this rather looks like local-policy problems, where a local script isn't being run or deleted or something. Is there any other potential setup from your environment that can influence this? You just mentioned the npm config set prefix
thing, but maybe there's more? Is there any corporate software running on your machine that could prevent running downloaded scripts? I know a common offender can be bit9 for instance: https://www.carbonblack.com/company/news/press-releases/07-23-13-bit9-introduces-the-bit9-platform-for-mac-a-new-generation-of-enterprise-mac-security-based-on-real-time-visibility-and-protection/
Hey @nicolasnoble , I don't understand what the issue was, but I installed node-gyp and then installed grpc and out of the blue Tada, it got installed. I am curious why this happened. Will try to debug later on a test project.
Oh. I think I know what the problem is. It's most likely https://github.com/mapbox/node-pre-gyp/issues/362, and if that's the case, it has to do with your version of npm. What is it?
6.4.1
I have the same problem with npm 6.4.1 and node 10.14.2 on Mac OS
The grpc
package has been deprecated. We recommend using @grpc/grpc-js
instead.
Problem description
Installing grpc via npm on a mac
Reproduction steps
Just did a
npm install grpc
also triednpm install grpc -g
Environment
Additional context
Complete Log