Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform architecture is undefined when trying to install #49

Open
adamalton opened this issue Jul 12, 2022 · 0 comments
Open

Platform architecture is undefined when trying to install #49

adamalton opened this issue Jul 12, 2022 · 0 comments
Labels
need/triage Needs initial labeling and prioritization

Comments

@adamalton
Copy link

v18.4.0 (npm v8.12.1).

I encountered this while trying to install ipns-publisher (which has go-ipfs as a dependency) on my M1 Mac. But the issue happens even just trying to do npm install go-ipfs:

$ npm install go-ipfs
npm WARN deprecated go-ipfs@0.10.0: Version no longer supported. Upgrade to 0.12.2 or later.
npm ERR! code 1
npm ERR! path /Users/adamalton/Sites/github/ipns-publisher/node_modules/go-ipfs
npm ERR! command failed
npm ERR! command sh -c node src/post-install.js
npm ERR! https://dist.ipfs.io/go-ipfs/versions
npm ERR! Error: No binary available for arch 'undefined'
npm ERR!     at getDownloadURL (/Users/adamalton/Sites/github/ipns-publisher/node_modules/go-ipfs/src/download.js:162:11)
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR!     at async download (/Users/adamalton/Sites/github/ipns-publisher/node_modules/go-ipfs/src/download.js:178:15)
npm ERR!     at async module.exports (/Users/adamalton/Sites/github/ipns-publisher/node_modules/go-ipfs/src/download.js:251:13)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/adamalton/.npm/_logs/2022-07-12T14_47_37_653Z-debug-0.log

So the problem seems to be coming from here: https://github.com/ipfs/npm-go-ipfs/blob/8b0e3d947f0af11a8704760f1f78d7b8a02324aa/src/download.js#L126

However, this works fine:

$ node
> process.arch
'arm64'

And running this successfully works around the problem:

TARGET_ARCH='arm64' npm install

It looks like this is a problem with go-platform. If I install and run it on its own (as per the instructions in its README) I get:

$ node_modules/.bin/go-platform
darwin-undefined

I've opened an issue on that repo, but logging this ticket here so that:

  1. Other people experiencing this problem can see the workaround.
  2. If the issue doesn't get fixed in go-platform (which was last updated 7 years ago) we can look at an alternative for this repo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

1 participant