Configuring remote Node.js interpreters
Required plugins:
JavaScript and TypeScript
, JavaScript Debugger
- The plugins are bundled with GoLand and enabled by default.
Node.js
and Node.js Remote Interpreter
- Install the plugins on the Settings | Plugins page, tab Marketplace.
note
Local interpreters are configured on the Node.js page, refer to Configuring a local Node.js interpreter.
In GoLand, you need to configure a remote Node.js interpreter when you want to develop, test, lint, run and debug your application on Node.js installed on a remote host or in a virtual environment.
Remote Node.js interpreters are configured in the Configure Node.js Remote Interpreter dialog. You can open this dialog from the Node.js page of the Settings dialog or later, when you create or edit a Node.js run/debug configuration for running or debugging your application in a remote environment.
The recommended way is to configure a remote Node.js interpreter in the Settings dialog. In this case you can set the interpreter and the associated package manager as default for your project.
A remote Node.js interpreter that you configure right in the Node.js run/debug configuration can be used only with this run/debug configuration.
Install the Node.js and Node.js Remote Interpreter plugins on the Settings | Plugins page, tab Marketplace, as described in Installing plugins from JetBrains Marketplace.
Make sure the FTP/SFTP/WebDAV Connectivity plugin is enabled in the settings. Press CtrlAlt0S to open settings and then select Plugins. Click the Installed tab. In the search field, type FTP/SFTP/WebDAV Connectivity. For more information about plugins, refer to Managing plugins.
Configure access to an SSH server on the target remote host as described in Create SSH configurations and make sure this server is running.
Node.js interpreters via SSH are configured in the Configure Node.js Remote Interpreter dialog. You can open this dialog from the Node.js page of the Settings dialog or later, when you create or edit a Node.js run/debug configuration for running or debugging your application.
The recommended way is to configure a remote Node.js interpreter in the Settings dialog. In this case you can set the interpreter and the associated package manager as default for your project.
A remote Node.js interpreter that you configure right in the Node.js run/debug configuration can be used only with this run/debug configuration.
Open the Settings dialog (CtrlAlt0S) and go to Languages & Frameworks | Node.js.
Click
next to the Node interpreter field.
In the Node.js Interpreters dialog with a list of all the currently configured interpreters, click
on the toolbar and select Add Remote from the context menu.
In the Configure Node.js Remote Interpreter dialog that opens, select SSH.
Select an SSH configuration to use.
Alternatively, click
and create a new SSH configuration as described in Create SSH configurations.
Click OK to return to the Node.js Interpreters dialog where the new interpreter is added to the list.
To set the newly configured interpreter as project default, select it in the list and click OK to return to the Node.js dialog.
GoLand automatically uses this interpreter every time you select the
Project
alias from Node Interpreter lists, for example, when creating run/debug configurations.To use the package manager associated with the new interpreter for managing your project dependencies, set this package manager as default in your project. To do that, specify the location of the package manager in the Package manager field.
The default location for npm executable is
/usr/local/lib/node_modules/npm
.
Go to Run | Edit Configurations. In the Edit Configuration dialog that opens, click
on the toolbar and select Node.js from the context menu. The Run/Debug Configuration: Node.js dialog opens.
Click
next to the Node interpreter field.
The Node.js Interpreters dialog opens.
Click
on the toolbar and select Add Remote from the context menu.
Configure a remote Node.js interpreter via SSH as described above.
With Vagrant, you can quickly bootstrap your Node.js application to run, debug, and profile it from GoLand.
Install the Node.js, Node.js Remote Interpreter, and Vagrant plugins on the Settings | Plugins page, tab Marketplace, as described in Installing plugins from JetBrains Marketplace.
Make sure Vagrant and Oracle's VirtualBox are downloaded, installed, and configured on your computer. For more information, refer to Vagrant.
Make sure that the parent folders of the following executable files are added to the system PATH variable:
vagrant.bat or vagrant from your Vagrant installation. This should be done automatically by the Vagrant installer.
VBoxManage.exe or VBoxManage from your Oracle's VirtualBox installation.
Node.js interpreters in Vagrant environments are configured in the Configure Node.js Remote Interpreter dialog. You can open this dialog from the Node.js page of the Settings dialog or later, when you create or edit a Node.js run/debug configuration for running or debugging your application in a Vagrant environment.
The recommended way is to configure a remote Node.js interpreter in the Settings dialog. In this case you can set the interpreter and the associated package manager as default for your project.
A remote Node.js interpreter that you configure right in the Node.js run/debug configuration can be used only with this run/debug configuration.
Open the Settings dialog (CtrlAlt0S) and go to Languages & Frameworks | Node.js.
Click
next to the Node interpreter field.
In the Node.js Interpreters dialog with a list of all the currently configured interpreters, click
on the toolbar and select Add Remote from the context menu.
In the Configure Node.js Remote Interpreter dialog that opens, select Vagrant.
Specify the Vagrant instance folder that points at the environment you are going to use.
Technically, it is the folder where the VagrantFile configuration file for the desired environment is located. Based on this setting, GoLand detects the Vagrant host and shows it as a link in the Vagrant Host URL read-only field.
By default, the field shows the current project folder.
In the Node.js interpreter path field, specify the location of the Node.js executable file.
To locate the Node.js executable, open the embedded Terminal (AltF12) and type:
vagrant ssh whereis node exit
Click OK to return to the Node.js Interpreters dialog where the new interpreter is added to the list.
To set the newly configured interpreter as project default, select it in the list and click OK to return to the Node.js dialog.
GoLand automatically uses this interpreter every time you select the
Project
alias from Node Interpreter lists, for example, when creating run/debug configurations.Specify the path to the package manager to use.
To locate the package manager, open the embedded Terminal (AltF12) and type:
vagrant ssh whereis <package manager> exit
Go to Run | Edit Configurations. In the Edit Configuration dialog that opens, click
on the toolbar and select Node.js from the context menu. The Run/Debug Configuration: Node.js dialog opens.
Click
next to the Node interpreter field. The Node.js Interpreters dialog opens.
Click
on the toolbar and select Add Remote from the context menu.
Configure a remote Node.js interpreter in a Vagrant environment as described above.
Thanks for your feedback!