npm install is inconsistent
See original GitHub issueI’m not able to consistently install clasp. I sometimes get these errors:
sudo npm i -g @google/clasp
/usr/local/bin/clasp -> /usr/local/lib/node_modules/@google/clasp/index.js
> grpc@1.12.2 install /usr/local/lib/node_modules/@google/clasp/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp WARN Pre-built binaries not installable for grpc@1.12.2 and node@8.11.2 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/src/node'
gyp WARN EACCES user "root" does not have permission to access the dev dir "/var/root/.node-gyp/8.11.2"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/.node-gyp"
gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/.node-gyp/8.11.2"
...
Configs
npm -v
5.6.0
node -v
v8.11.2
Command
sudo npm i -g @google/clasp
/usr/local/bin/clasp -> /usr/local/lib/node_modules/@google/clasp/index.js
+ @google/clasp@1.3.1
updated 1 package in 11.211s
sudo npm uninstall -g @google/clasp
Possible Solutions
This seems to not give the errors:
sudo npm i -g @google/clasp --allow-root
Another option would be to remove grpc
, but I believe it is needed with a different npm module.
sudo npm i -g @google/clasp --unsafe-perm
seems to always work too.
However, running clasp gives this error still:
/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/src/grpc_extension.js:45
throw error;
^
Error: The gRPC binary module was not installed. This may be fixed by running "npm rebuild"
Original error: Cannot find module '/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/src/node/extension_binary/node-v57-darwin-x64-unknown/grpc_node.node'
at Object.<anonymous> (/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/src/grpc_extension.js:43:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@google/clasp/node_modules/grpc/src/client_interceptors.js:145:12)
at Module._compile (module.js:652:30)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Inconsistent behaviour when installing NPM packages globally
I have a feeling that NPM has some sort of inconsistent behaviour when installing packages. When installing globally, it runs successfully but ...
Read more >npm behaving very strange and inconsistent on 'npm install'.
Originally filed bug with gifsicle, but it was determined that npm packages were broken. Please refer to: kohler/gifsicle#52 (comment).
Read more >Docker local NodeJS install NPM modules is inconsistent - Bugs ...
Clicking the “install NPM modules” doesn't solve the problem, but clicking the “Deploy” button solves. The procedure for installing NPM modules needs to...
Read more >npm-outdated
This command will check the registry to see if any (or, specific) installed packages are currently outdated. By default, only the direct dependencies...
Read more >@barusu/tool-find-inconsistent NPM | npm.io
Install. npm install -g @barusu/tool-find-inconsistent. yarn yarn global add @barusu/tool-find-inconsistent. Usage. Check if the version number of the same ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think grpc is used for StackDriver logs (
@google-cloud/logging
):If this is the case, we should remove
@google-cloud/logging
in favor ofgoogleapis
.Running
sudo npm rebuild
in theclasp
folder fixes the CLI. Maybe it should be added as a postinstall step.