Skip to content

Commit c851ed1

Browse files
committed
Fixing #17
1 parent 473ddea commit c851ed1

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/Environment.php

+8
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ public static function isLinux()
3838
return PHP_OS === 'Linux';
3939
}
4040

41+
/**
42+
* @return bool True if processor is Arm.
43+
*/
44+
public static function isArm()
45+
{
46+
return strpos(strtolower(php_uname("m"), "arm")) === 0;
47+
}
48+
4149
/**
4250
* @return int Returns 32 or 64 depending on supported architecture.
4351
*/

src/NodeJsInstaller.php

+2
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ public function getNodeJSUrl($version)
159159
return "http://nodejs.org/dist/v".$version."/node-v".$version."-sunos-x86.tar.gz";
160160
} elseif (Environment::isSunOS() && Environment::getArchitecture() == 64) {
161161
return "http://nodejs.org/dist/v".$version."/node-v".$version."-sunos-x64.tar.gz";
162+
} elseif (Environment::isLinux() && Environment::isArm()) {
163+
throw new NodeJsInstallerException('NodeJS-installer cannot install Node on computers with ARM processors. Please install NodeJS globally on your machine first, then run composer again.');
162164
} elseif (Environment::isLinux() && Environment::getArchitecture() == 32) {
163165
return "http://nodejs.org/dist/v".$version."/node-v".$version."-linux-x86.tar.gz";
164166
} elseif (Environment::isLinux() && Environment::getArchitecture() == 64) {

0 commit comments

Comments
 (0)