Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f74c42c

Browse files
authored
Merge pull request #13077 from meteor/tweaks-meteor-installer
[3.x] Support Linux ARM with the Meteor installer
2 parents 2ab41e1 + 8e3fef2 commit f74c42c

File tree

5 files changed

+75
-63
lines changed

5 files changed

+75
-63
lines changed

npm-packages/meteor-installer/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ function isSudo() {
1212
const localAppData = process.env.LOCALAPPDATA;
1313
const isWindows = () => os.platform() === 'win32';
1414
const isMac = () => os.platform() === 'darwin';
15+
const isLinux = () => os.platform() === 'linux';
1516

1617
let rootPath;
1718
if (isWindows()) {
@@ -47,6 +48,7 @@ module.exports = {
4748
startedPath: path.resolve(rootPath, '.meteor-install-started.txt'),
4849
isWindows,
4950
isMac,
51+
isLinux,
5052
isRoot,
5153
isSudo,
5254
shouldSetupExecPath,

npm-packages/meteor-installer/install.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const {
2020
rootPath,
2121
sudoUser,
2222
isSudo,
23-
isMac,
23+
isLinux,
2424
METEOR_LATEST_VERSION,
2525
shouldSetupExecPath,
2626
} = require('./config');
@@ -62,12 +62,13 @@ if (!isInstalledGlobally) {
6262
process.on('unhandledRejection', err => {
6363
throw err;
6464
});
65+
6566
if (os.arch() !== 'x64') {
6667
const isValidM1Version = semver.gte(
6768
semver.coerce(METEOR_LATEST_VERSION),
6869
'2.5.1-beta.3',
6970
);
70-
if (os.arch() !== 'arm64' || !isMac() || !isValidM1Version) {
71+
if (os.arch() !== 'arm64' || !isValidM1Version) {
7172
console.error(
7273
'The current architecture is not supported in this version: ',
7374
os.arch(),
@@ -83,9 +84,15 @@ const downloadPlatform = {
8384
linux: 'linux',
8485
};
8586

86-
const url = `https://packages.meteor.com/bootstrap-link?arch=os.${
87-
downloadPlatform[os.platform()]
88-
}.${os.arch() === 'arm64' ? 'arm64' : 'x86_64'}&release=${release}`;
87+
function getDownloadArch() {
88+
const osArch = os.arch();
89+
if (isLinux() && osArch === 'arm64') return 'aarch64';
90+
if (osArch === 'arm64') return 'arm64';
91+
return 'x86_64';
92+
}
93+
94+
const arch = `os.${downloadPlatform[os.platform()]}.${getDownloadArch()}`;
95+
const url = `https://packages.meteor.com/bootstrap-link?arch=${arch}&release=${release}`;
8996

9097
let tempDirObject;
9198
try {
@@ -153,6 +160,9 @@ try {
153160
}
154161
}
155162

163+
console.log(`=> Arch: ${arch}`);
164+
console.log(`=> Meteor Release: ${release}`);
165+
156166
download();
157167

158168
function generateProxyAgent() {

npm-packages/meteor-installer/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm-packages/meteor-installer/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meteor",
3-
"version": "3.0.0-beta.8",
3+
"version": "3.0.0-beta.10",
44
"description": "Install Meteor",
55
"main": "install.js",
66
"scripts": {
@@ -24,7 +24,7 @@
2424
"meteor-installer": "cli.js"
2525
},
2626
"engines": {
27-
"node": "<=20.x",
28-
"npm": "<=10.x"
27+
"node": ">=20.x",
28+
"npm": ">=10.x"
2929
}
3030
}

packages/npm-mongo/.npm/package/npm-shrinkwrap.json

Lines changed: 51 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)