run-script-os icon indicating copy to clipboard operation
run-script-os copied to clipboard

`npx run-script-os` fails on Apple Mac M1

Open brionmario opened this issue 3 years ago • 4 comments

I recently changed my workstation to an Apple Mac M1 and I was running the run-script-os with npx. With the above system change, suddenly the commands we failing with the following error.

Script

  "compile": "npx run-script-os",
  "compile:win32": "..\\..\\node_modules\\.bin\\tsc -p tsconfig.json --incremental",
  "compile:default": "../../node_modules/.bin/tsc -p tsconfig.json --incremental",

Stacktrace

run-script-os was unable to execute the script 'npx'
npm ERR! Lifecycle script `compile` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: ---
npm ERR!   at location: ---
npm ERR! Lifecycle script `build` failed with error: 
npm ERR! Error: command failed 
npm ERR!   in workspace: ---
npm ERR!   at location: ---

When I remove the npx prefix, everything works. Any ideas?

brionmario avatar May 27 '22 05:05 brionmario

Having the same issue on a different environment (Linux).

jpdias avatar Jun 29 '23 17:06 jpdias

For macOS you would need to ensure you have the development dependency:

  • npm i -D dmg-license

If that fails you can always add "build:default". Pretty much been using "build:default" as the m1 detector. I know this is not very reliable but it's what you got.

FranciscoKloganB avatar Oct 13 '23 21:10 FranciscoKloganB

We ended up removing run-script-os entirely from our project.

brionmario avatar Dec 20 '23 13:12 brionmario

@FranciscoKloganB I added architecture detection in this PR so you can specify arm64, x64, etc- https://github.com/charlesguse/run-script-os/pull/54

  • postinstall:darwin - OSX
  • postinstall:darwin-x64 - Intel Macs
  • postinstall:darwin-arm64 - Apple Silicon/ARM Macs

doublesharp avatar Aug 21 '24 15:08 doublesharp