添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
英俊的大脸猫  ·  文智涌_百度百科·  4 月前    · 
热情的黑框眼镜  ·  How to Reset Your BT ...·  8 月前    · 

PhpStorm 2024.1 Help

Configure Node.js Remote Interpreter Dialog

The following Node.js versions are supported in PhpStorm 2023.3 and later:

  • Node.js 20 - the Active Long Term Supported (LTS) version

  • Node.js 21 - the current version

Learn more from Supported Node.js versions .

The dialog opens when you click Add the Add button in the Node.js Interpreters dialog and choose Remote... from the drop-down menu. This menu item is available only when you open the Node.js Interpreters dialog from the Run/Debug Configuration: Node.js .

Use this dialog to configure access to Node.js installations on remote hosts or in development environments set up in Vagrant instances.

Configuring a remote Node.js interpreter on Docker

Item

Description

SSH

Select this option to configure access to a Node.js interpreter on a remote host or environment that is accessible through SSH credentials. Select the relevant SSH configuration and check the path to the default Node.js interpreter from the remote host or environment.

Learn more from Create SSH configurations .

Docker

This option is available only when the Node.js , Node.js Remote Interpreter , and Docker Integration plugins are installed and enabled as described in Installing plugins from repository .

Select this option to use a Node.js interpreter that is running in a Docker container.

  1. In the Server field, specify the Docker configuration to use. For more information, refer to Configure the Docker daemon connection settings . Select a configuration from the list or click New... and create a new configuration on the Docker page that opens.

  2. In the Image name field, specify the base Docker image to use. Choose one of the previously downloaded or your custom images from the list or type the image name manually, for example, node:argon or mhart/alpine-node . When you later launch the run configuration, Docker will search for the specified image on your machine. If the search fails, the image will be downloaded from the Docker Official Images repository on the Docker Registry page .

  3. The Node.js interpreter path field shows the location of the default Node.js interpreter from the specified image.

  4. When you click OK , PhpStorm closes the Configure Node.js Remote Interpreter dialog and brings you to the Node.js Interpreters dialog where the new interpreter configuration is added to the list. Click OK to return to the run configuration.

Docker Compose

This option is available only when the Node.js , Node.js Remote Interpreter , and Docker Integration plugins are installed and enabled as described in Installing plugins from repository .

Select this option to use a Node.js interpreter configuration defined in a Docker Compose file docker-compose.yml . Note that this file must have node or npm in the command field, for example, command: node ./src/app.js . For more information, refer to the Docker official website .

  1. In the Server field, specify the Docker configuration to use. For more information, refer to Configure the Docker daemon connection settings . Select a configuration from the list or click New... and create a new configuration on the Docker page that opens.

  2. In the Configuration file(s) field, specify the docker-compose.yml file that defines the application's services.

  3. From the Service list, select the service you want to run.

  4. Optionally, in the Environment variables field, define the environment variables. For more information, refer to Docker Compose run configuration settings.

Vagrant

This option is available only when the Vagrant plugin is installed and enabled. The Vagrant plugin is not bundled with PhpStorm, but it can be installed on the Settings | Plugins page, tab Marketplace , as described in Installing plugins from JetBrains Marketplace .

Choose this option to configure access to a Node.js interpreter installed in a Vagrant instance using your Vagrant credentials. Technically, it is the folder where the VagrantFile configuration file for the desired environment is located. Based on this setting, PhpStorm detects the Vagrant host and shows it as a link in the Vagrant Host URL read-only field.

To use an interpreter configuration, you need path mappings that set correspondence between the project folders, the folders on the server to copy project files to, and the URL addresses to access the copied data on the server. PhpStorm evaluates path mappings from the VagrantFile configuration file.

Node.js Interpreter Path

In this field, specify the location of the Node.js executable file in accordance with the configuration of the selected remote development environment.

  • For Vagrant instances, PhpStorm by default suggests the /usr/bin/node location.

  • For Docker containers, PhpStorm by default suggests the node location.

To specify a different folder, click Open and choose the relevant folder in the dialog that opens. Note that the Node.js home directory must be open for editing.

When you click OK , PhpStorm checks whether the Node.js executable is actually stored in the specified folder.

  • If no Node.js executable is found, PhpStorm displays an error message asking you whether to continue searching or save the interpreter configuration anyway.

  • If the Node.js executable is found, you return to the Node.js Interpreters dialog where the installation folder and the detected version of the Node.js interpreter are displayed.

Last modified: 31 May 2024