Coder Social home page Coder Social logo

Comments (8)

sonofhammer avatar sonofhammer commented on August 15, 2024 3

I did a bit of digging and found the following.
instalArchSpecificPackage figures out which node-{platform}-{architecture} package to install by getting the process.platform and process.arch values from NodeJS.Process

unfortunately, process.arch only has the following possible values

'arm', 'arm64', 'ia32', 'mips', 'mipsel', 'ppc', 'ppc64', 's390', 's390x', 'x32', and 'x64'.

The node packages that are available on npmjs.org use a different naming convention and spell out the specific architecture version node-linux-arm64 or node-linux-armv7l or node-linux-armv6l. They follow the naming convention of binaries on nodejs.org

relevant bit of code from instalArchSpecificPackage from node-bin-setup function below

  var platform = process.platform == 'win32' ? 'win' : process.platform;
  var arch = platform == 'win' && process.arch == 'ia32' ? 'x86' : process.arch;

  var cp = spawn(platform == 'win' ? 'npm.cmd' : 'npm', ['install', '--no-save', ['node', platform, arch].join('-') + '@' + version], {
    stdio: 'inherit',
    shell: true
  })

Note how there's additional handling for windows flavor of process.arch. Similar additional handling needs to be added for arm architecture.

from node-bin-gen.

VadneyK avatar VadneyK commented on August 15, 2024 1

similar issue with M1 chip: #124

from node-bin-gen.

VadneyK avatar VadneyK commented on August 15, 2024 1

View the solution to the similar issue: #124

from node-bin-gen.

mdarfay avatar mdarfay commented on August 15, 2024 1

Any update on the issue ? Just trying to install an existing project on a Raspberry Pi 3 and got the same error (architecture being armv7l.

from node-bin-gen.

psycr0w13 avatar psycr0w13 commented on August 15, 2024

Hey Guys,
I got the same problem --> I want to install my docker container which has node in its package.json on a raspbian stretch lite Raspberry Pi via yarn/npm install and get the same error:

`error /usr/src/app/node_modules/node: Command failed.
Exit code: 1
Command: node installArchSpecificPackage
Arguments:
Directory: /usr/src/app/node_modules/node
Output:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.yarnpkg.com/node-linux-arm - Not found
npm ERR! 404
npm ERR! 404 '[email protected]' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-05-07T08_24_01_424Z-debug.log
internal/modules/cjs/loader.js:613
throw err;
^

Error: Cannot find module 'node-linux-arm/package.json'
Require stack:

  • /usr/src/app/node_modules/node/installArchSpecificPackage.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:610:15)
    at Function.resolve (internal/modules/cjs/helpers.js:21:19)
    at ChildProcess. (/usr/src/app/node_modules/node-bin-setup/index.js:18:27)
    at ChildProcess.emit (events.js:196:13)
    at maybeClose (internal/child_process.js:1000:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)`

The answer describes really nice what the problem is, but how can I solve this? I need to install node in the docker container when building it. I found a way to install node globally on my Pi, but how can I install it in my container when building it on the Pi?

It would be so great if anybody could help me.
Thank you very much in advance :)

from node-bin-gen.

VadneyK avatar VadneyK commented on August 15, 2024

We really need this issue resolved: #126

from node-bin-gen.

e-dant avatar e-dant commented on August 15, 2024

Any updates? Making it very difficult to develop from a pi.

from node-bin-gen.

StefanLobbenmeier avatar StefanLobbenmeier commented on August 15, 2024

Somehow there is already a discussion about this fix but not linked to here:
#57
aredridel/node-bin-setup#2

from node-bin-gen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.