n: "no version found" error on Mac with M1 chip
Using n current or n 8 etc on a Mac with the M1 chip and an older version of n will currently display an error that “no version found”, because there are not yet native versions of node available for the new architecture.
You can download and run node built for the Intel x64 architecture. The installed node will run using Rosetta 2. e.g.
n --arch x64 lts
Another approach is to launch Terminal itself using Rosetta, so that the terminal environment assumes x64.
The n behaviour on Apple M1 will be reviewed when nodejs decide their plans for support:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 8
- Comments: 18
Thanks for the info! 😄
For now, I’ll continue to use my workaround via Homebrew which I’ll document here in case it helps anyone else:
When it runs, activity monitor happily shows the Architecture as “Apple” as expected:
If an older version is installed, e.g. Node 12, which has a different
lib/node_modules/npmthen problems arise, but if mostly using one version it seems OK.Some discussion on https://github.com/nodejs/build/issues/2474 in last day is that nodejs are thinking of shipping a fat binary from node 16.
I have been wondering about releasing an interim version of
nwhich defaults to x64 for now, and fine tune it after nodejs start releasing native versions.Readers, let me know if this would be useful with a 👍 or comment.
Node.js 16 will have a native Apple silicon build (arm64).
There will be a new version of
nto default to arm64 native for Node.js v16 and higher.If Node.js 16 comes out before
nis updated, then fornv6.8.0 through v7.1.0 you can specify the architecture explicitly to override it defaulting to x64:ndoes not keep track of which architecture is downloaded, so if you installed x64 first then remove it and download again:@shadowspawn wow, you’re right! 😱 it’s gone.
Released
nv7.2.1 in preparation for Node.js 16 release.Thanks for confirming @parndt 😄
I don’t have an Apple Silicon Mac and the index.tab did not get updated with arm64 until this morning and Node.js 16 wasn’t out, so while I was fairly confident from manual tests, good to hear it works with the actual release!