Getting stuck to create webstorm command line
Hello, everyone,
I am a beginner in using WebStorm (I downloaded and installed the IDE a few hours ago).
I am trying to add the webstorm
command in order to launch any project on WebStrom from the CLI.
On WebStorm, I ran “Tools > Create Command-Line Launcher…”. Then, I got a popup with the following message:
Configuring Command-Line Launcher
To make the IDE accessible from the command line, please add '/Applications/WebStorm.app/Contents/MacOS' to the $PATH variable and use 'webstorm' to run commands. Please see the online help for more details.
I went to the link showed by the popup, but I am getting stuck. I do not know where to create the shell script, nor where to find the PATH
environment variable, nor where to find the place where to add what the popup says.
Here are the information about my copy of WebStorm:
WebStorm 2024.3.1
Build #WS-243.22562.112, built on December 4, 2024
Subscription is active until December 7, 2025.
For non-commercial use only.
Runtime version: 21.0.5+8-b631.28 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.1
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 8
Metal Rendering is ON
Registry:
ide.experimental.ui=true
i18n.locale=
Non-Bundled Plugins:
com.github.biomejs.intellijbiome (1.5.2)
I am running it on a MacBook Air M2.
Thanks if you can help me.
请先登录再写评论。
Please use the steps above:
1. Create a file named `webstorm` in `/usr/local/bin/` folder with the following contents:
#!/bin/sh
open -na "WebStorm.app" --args "$@"
2. Open a Terminal, run "chmod +x /usr/local/bin/webstorm".
3. After that, you should be able to use webstorm command to start the WebStorm.
Does it help?
It does not help much.
When trying to create the file and place it into the folder indicated, I have “Permission denied”. If I create in CLI, typing
touch usr/local/bin/webstorm
, I have the message “Permission denied” displayed on the terminal. And thus despite the fact I am logged in my Mac as a user having admin privileges.And where do I have to add
'/Applications/WebStorm.app/Contents/MacOS'
to the$PATH
variable? In.zshrc
file?You can also use the `$PATH` way too. Adding export PATH=$PATH:/Applications/WebStorm.app/Contents/MacOS in ~/.zshrc and restarting the Terminal should help.
I ran the
sudo nano
command, created the requested file, ran thechmod
command and resolved the problem.Thank you.