Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

npm fail #1341

Closed
xuruijing opened this issue May 8, 2018 · 12 comments
Closed

npm fail #1341

xuruijing opened this issue May 8, 2018 · 12 comments

Comments

@xuruijing
Copy link

I run this command in Mac

sudo npm install ipfs --global

result a warnning "deprecated [email protected]: use libp2p-mplex instead"

and a error "Command failed: /usr/bin/git clone -q git://github.com/dignifiedquire/multiplex.git /Users/xuruijing/.npm/_cacache/tmp/git-clone-c8dde9da
npm ERR! /Users/xuruijing/.npm/_cacache/tmp/git-clone-c8dde9da/.git: Permission denied"

why? Who has run into such a problem?

npm -v
5.6.0

node -v
v8.11.1

@victorb
Copy link
Member

victorb commented May 8, 2018

The problem was fixed here: libp2p/js-libp2p-mplex@20cf80a#diff-b9cfc7f2cdf78a7f4b91a753d10865a2 but has yet to been released. Once we have a new release of js-ipfs (subscribe to this issue for updates), this issue will go away.

Basically, npm somehow tries to clone the repository with the ssh endpoint instead of https, meaning that GitHub will try to auth you with the repository dignifiedquire/multiplex. Since you don't have read/write access to that repository, it gets denied. We should take care in the future to specify https git urls (or even better, no git urls at all in package.json)

Ps, you should never run npm with sudo as it pulls down a lot of packages and if a package is compromised, they now have root access to your machine. Please read the following documentation from npm on how to solve this issue: https://docs.npmjs.com/getting-started/fixing-npm-permissions

@xuruijing
Copy link
Author

According to the NPM documentation you provided, I installed the NVM and used the command "npm install ipfs --global", There are other errors in execution results.

node-pre-gyp ERR! Tried to download(403): https://node-binaries.s3.amazonaws.com/gcstats/v1.1.1/Release/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v64 ABI, unknown) (falling back to source compile with node-gyp)

In file included from ../node_modules/nan/nan.h:192:
../node_modules/nan/nan_maybe_43_inl.h:112:15: error: no member named 'ForceSet'
in 'v8::Object'
return obj->ForceSet(isolate->GetCurrentContext(), key, value, attribs);
~~~ ^

npm -v
5.6.0

node -v
v10.0.0

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

@xuruijing I'll look into this, I might have come across the same problem

@victorb
Copy link
Member

victorb commented May 9, 2018

Yeah, I'm pretty sure js-ipfs doesn't currently work with 10.0.0. Some packages even define that they don't work with 10.0.0 and if you're using yarn, it won't even try to install the dependencies because of the strictness.

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

LevelDB is failing to compile for me both with the current version 0.28 and master on Node.js 10.x. Possibly others...

refs ipfs/js-datastore-level#6

@xuruijing
Copy link
Author

I changed node.js to version 8.11.1, and the compilation will not show the last error, but the previous error still exists, and I wonder if it will affect the running of ipfs?

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

Looks like js-ipfs-repo depends on level.js (a fork) and leveldown as well as datastore-level. It shims out leveldown for level.js in the browser.

I think @richardschneider is right this should be pushed into datastore-level.

It would be great to sort that out as well whilst upgrading leveldown to a version that works with Node.js 10.x.

@xuruijing
Copy link
Author

Also, do I have to install it manually?

npm WARN [email protected] requires a peer of chai@>=2.2.1 <5 but none is installed. You must install peer dependencies yourself.

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

I changed node.js to version 8.11.1, and the compilation will not show the last error, but the previous error still exists, and I wonder if it will affect the running of ipfs?

Which error are you referring to?

@xuruijing
Copy link
Author

node-pre-gyp ERR! Tried to download(403): https://node-binaries.s3.amazonaws.com/gcstats/v1.1.1/Release/node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI, unknown) (falling back to source compile with node-gyp)

This error still exists after changing the node.js version.

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

@xuruijing I think that's ok, it just means that npm has had to compile something because a pre-built binary didn't exist.

@alanshaw
Copy link
Member

alanshaw commented May 9, 2018

I've created an issue here to track the Node.js 10.x issue: #1347

Thanks @xuruijing

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants