I am trying to get Meteor running in a Node JS ARM based container.
My understanding is, that Meteor since some versions ago, has ARM support, so this should work. (I know, I need to get an external Mongo.)
Now, what puzzles me, is that the installer gives me the following error.
[1/2] STEP 11/16: run npm install -g meteor
/home/node/.npm-global/bin/meteor-installer -> /home/node/.npm-global/lib/node_modules/meteor/cli.js
> **meteor@2.8.2** install /home/node/.npm-global/lib/node_modules/meteor
> node cli.js install
The current architecture is not supported in this version: arm64 . **Try Meteor 2.5.1-beta.3 or above**.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! meteor@2.8.2 install: `node cli.js install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor@2.8.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/node/.npm/_logs/2022-12-09T15_31_07_806Z-debug.log
Error: building at STEP "RUN npm install -g meteor": while running runtime: exit status 1
So effectively a 2.8.2 installer is asking me to upgrade to 2.5.1 or above.
What is happening here?
@hschmaiske for clarity, the βrunβ you are seeing is created by docker/podman build files and is only shown as part of the output logs. Effectively this executes a βplainβ npm install -g meteor in the container.
I took a moment to look into the meteor source. The root cause of my issue is in line 58 of the install.js
Seems the rules for non x86 are very tight, i.e. it must be arm64 on a Mac.
Now what I am doing, is I am trying to dockerize a meteor installation based on an ARM build of the node.js docker image on a M1 Mac. This means that while architecture matches, the platform though is not Darwin but Linux. So at least the check for Darwin will fail.
For comparison, that is what I get on my M1 Mac for uname:
Darwin myMacbook 21.6.0 Darwin Kernel Version 21.6.0: Thu Sep 29 20:13:56 PDT 2022; root:xnu-8020.240.7~1/RELEASE_ARM64_T6000 arm64
And hereβs the uname output while inside the docker env running on that same Mac:
Linux 292116d93241 6.0.9-300.fc37.aarch64 #1 SMP PREEMPT_DYNAMIC Wed Nov 16 17:04:07 UTC 2022 aarch64 GNU/Linux
So it is pretty clear why this wonβt work like it is right now. The question for me is, if the check is simply too strict because no-one so far tried to run Meteor on ARM based Linux, or if this was a conscious choice by the MDG because they found out that it wonβt work for other reasons.
m1air:~$ uname -a
Linux m1air 6.8.0-1011-asahi-arm #11-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 25 18:1x
m1air:~$ npx meteor
=> Arch: os.linux.aarch64
=> Meteor Release: 3.0.1
Downloading |ββββββββββββββββββββββββββββββββββββββββ| 0%node:events:497
throw er; // Unhandled 'error' event
^
Error: Response status was 403
at ClientRequest.<anonymous> (/home/wekan/.npm/_npx/a161db0e9e033064/node_m)
at Object.onceWrapper (node:events:634:26)
at ClientRequest.emit (node:events:519:28)
at HTTPParser.parserOnIncomingClient [as onIncoming] (node:_http_client:698)
at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
at TLSSocket.socketOnData (node:_http_client:540:22)
at TLSSocket.emit (node:events:519:28)
at addChunk (node:internal/streams/readable:559:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
at Readable.push (node:internal/streams/readable:390:5)
Emitted 'error' event on b instance at:
at ClientRequest.<anonymous> (/home/wekan/.npm/_npx/a161db0e9e033064/node_m)
at Object.onceWrapper (node:events:634:26)
[... lines matching original stack trace ...]
at Readable.push (node:internal/streams/readable:390:5) {
status: 403,
body: ''
}
Node.js v20.15.1
m1air:~$ uname -a
Linux m1air 6.8.0-1011-asahi-arm #11-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 25 18:1x
m1air:~$ npx meteor@beta
=> Arch: os.linux.aarch64
=> Meteor Release: 3.0-beta.7
=> Meteor Downloaded in 19.536s
=> Extracting the tarball, this may take some time
=> Meteor extracted in 7.567s
***************************************
Meteor has been installed!
To get started fast:
$ meteor create ~/my_cool_app
$ cd ~/my_cool_app
$ meteor
Or see the docs at:
docs.meteor.com
Deploy and host your app with Cloud:
www.meteor.com/cloud
***************************************
You might need to open a new terminal window to have access to the meteor command, or run this in your terminal:
export PATH=/home/user/.meteor:$PATH
For adding it immediately to your path.
***************************************
m1air:~$ meteor create --release 3.0.1
? What is the name/path of your app? (my-app)
m1air:~$ npx meteor
=> Arch: os.linux.aarch64
=> Meteor Release: 3.0.1
=> Meteor Downloaded in 11.153s
=> Extracting the tarball, this may take some time
=> Meteor extracted in 7.641s
***************************************
Meteor has been installed!
To get started fast:
$ meteor create ~/my_cool_app
$ cd ~/my_cool_app
$ meteor
Or see the docs at:
docs.meteor.com
Deploy and host your app with Cloud:
www.meteor.com/cloud
***************************************
You might need to open a new terminal window to have access to the meteor command, or run this in your terminal:
export PATH=/home/user/.meteor:$PATH
For adding it immediately to your path.
***************************************
m1air:~$ meteor create
? What is the name/path of your app?