Max M1 (once again)

Hello!

Can’t get meteor 2.7.3 running on Mac M1. Getting this error Bad CPU type in executable:

=> Started proxy.
=> Started HMR server.
arch: posix_spawnp:
/Users/a.pivovarov/.meteor/packages/meteor-tool/.2.7.3.1liadnk.e36f++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod: Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
arch: posix_spawnp:
/Users/a.pivovarov/.meteor/packages/meteor-tool/.2.7.3.1liadnk.e36f++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod: Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
arch: posix_spawnp:
/Users/a.pivovarov/.meteor/packages/meteor-tool/.2.7.3.1liadnk.e36f++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod: Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
Can't start Mongo server.
MongoDB failed global initialization

When I checked mongod in this directory file …/mongod it says that it’s for x86: /mongod: Mach-O 64-bit executable x86_6

I’m not sure about this solution, but I had similar problems, and re-installing meteor fixed it for me.

The other option is to run mongo as a separate process, and use something like this

 MONGO_URL=mongodb://localhost/my-database meteor run

This also has the advantage that a meteor reset doesn’t blow away your data

The other option is to run mongo as a separate process

Thanks, probably I will go this way.

I’m not sure about this solution, but I had similar problems, and re-installing meteor fixed it for me.

I did it multiple times with different versions. The strange thing is - I downloaded tarball with installation manually and I found that the bundled mongod is for x86 architecture. I tried to replace it with arm64 version I installed separately but again I got the same error.

It seems to me that rosetta is not required for meteor itself but it does required for running mongodb in development… :man_shrugging:t2:

Has this been resolved? If so, please explain how.

I gave up for now. Will try to run MongoDB as a separate process when I have time for experiments. Using rosetta terminal should help too.

I had the same problem, I solved it with install meteor with npm install -g meteor instead or sh script and it works :slight_smile:

3 Likes

Same here, not sure why but it only works with npm install -g meteor
I’ll ask to someone to take a closer look into it

I’m still trying to get meteor running on Apple Silicon M3 Max.

i tried both: using npm install -g meteor, using the shell

Still i get this error:

[[[[[ ~/Projects/meteorm3 ]]]]]

=> Started proxy.
=> Started HMR server.
arch: posix_spawnp:
/Users/mbp/.meteor/packages/meteor-tool/.2.14.0.1yb47c7.yuzg++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod:
Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
arch: posix_spawnp:
/Users/mbp/.meteor/packages/meteor-tool/.2.14.0.1yb47c7.yuzg++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod:
Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
arch: posix_spawnp:
/Users/mbp/.meteor/packages/meteor-tool/.2.14.0.1yb47c7.yuzg++os.osx.arm64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.arm64/dev_bundle/mongodb/bin/mongod:
Bad CPU type in executable
Unexpected mongo exit code 1. Restarting.
Can’t start Mongo server.
MongoDB failed global initialization

Anybody experiencing a similar problem?

I’m running Meteor 2.6.1 on an M3 Max without any issues. Also tried another repo that uses 2.14 today, which also worked. Mongo was running locally, embedded in Meteor, in both cases.

thanks a lot for your support! Can you also tell me what your node version was when you installed meteor and what method you used (npm install -g meteor or the shell script). Thank you

Now, I’ve finally resolved the issue. I needed to install Rosetta 2 on my Mac, which I did using the following terminal command:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

Initially, I thought I wouldn’t need Rosetta 2, as it was suggested that Meteor could run without it. However, it became evident that either Meteor or MongoDB (or both) required Rosetta 2 to function properly.

Yeah the bundled MongoDB is Intel only, even if there now is an Apple Silicon version. It should be straightforward to replace it in some upcoming meteor version

2 Likes

Henrique,

Did anyone from the team follow up on this? If so, what did they find?

Second, is it possible to detect arch when running the install script and then install the native version of MongoDB? From reading the MongoDB community edition documentation, it no longer looks possible to do so without homebrew and so all installs are global (https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/)

So is the solution requiring Rosetta2 to be installed before running Meteor on Apple Silicon? If so, confirm and close as solved.