yyx990803 / launch-editor

Open file in editor from Node.js.
MIT License
585 stars 67 forks source link

Currently can't open webstorm from MacOS with m1 #38

Closed Kolobok12309 closed 2 years ago

Kolobok12309 commented 2 years ago

Currently output if i try launchEditor(filePath)

2022-04-18 18:02:27.126 webstorm[50917:1148523] allVms required 1.8*,1.8+
2022-04-18 18:02:27.127 webstorm[50917:1148527] Cannot load JVM bundle: Error Domain=NSCocoaErrorDomain Code=3585 "dlopen_preflight(/Applications/WebStorm.app/Contents/jbr/Contents/MacOS/libjli.dylib) => false, tried: '/Applications/WebStorm.app/Contents/jbr/Contents/MacOS/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libjli.dylib' (no such file)" UserInfo={NSLocalizedFailureReason=The bundle doesn’t contain a version for the current architecture., NSLocalizedRecoverySuggestion=Try installing a universal version of the bundle., NSFilePath=/Applications/WebStorm.app/Contents/jbr/Contents/MacOS/libjli.dylib, NSDebugDescription=dlopen_preflight(/Applications/WebStorm.app/Contents/jbr/Contents/MacOS/libjli.dylib) => false, tried: '/Applications/WebStorm.app/Contents/jbr/Contents/MacOS/libjli.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/libjli.dylib' (no such file), NSBundlePath=/Applications/WebStorm.app/Contents/jbr, NSLocalizedDescription=The bundle “OpenJDK 11.0.13” couldn’t be loaded because it doesn’t contain a version for the current architecture.}

Could not open index.vue in the editor.
The editor process exited with an error: (code 255).

If i try launchEditor(filePath, 'webstorm'), all worked fine, but i think it's not normal

nrayburn-tech commented 2 years ago

launchEditor is successfully calling the process to open WebStorm. It looks like WebStorm is just failing to load something Java related.

launchEditor(filePath, 'webstorm') launches WebStorm with webstorm as the terminal command. launchEditor(filePath) launches WebStorm with /Applications/WebStorm.app/Contents/MacOS/webstorm as the terminal command.

If you run the above commands directly in a terminal, I expect you will have the same errors.

I don't think anybody here will be able to help you much, it's likely out of the scope of this library. However, my best guess from the error is that your WebStorm installation in the Applications folder is an older version as it references a JDK 11 that is not built for the M1 chipset.