Home >Web Front-end >JS Tutorial >How to configure and install node.js in IDEA? Brief analysis of methods
How to run
node in IDEA? The following article will introduce to you how to configure, install and run node.js in IDEA. I hope it will be helpful to you!
idea supports running many programming languages. You only need to install the corresponding language environment on your computer, and then download and install the corresponding language environment in the setting->plugins of idea. Language plug-in, finally find the corresponding language in setting->languages&frameworks and configure the installed language compiler path.
For example node.js
Go directly to the official website to download and install: https ://nodejs.org/zh-cn/
After the installation is complete, use the node --verison command to check. If the version number is displayed, the installation is successful. [Related tutorial recommendations: nodejs video tutorial, Programming teaching]
And now the node.js installation package comes with npm , you can also see the npm version number by executing the npm -v command on the command line, but the environment variable of the global installation package path will not be automatically configured for npm during installation (if it is not configured, you may report that the package cannot be found when running the js program. mistake). First use the npm list -g command to display the global installation package path, and then add a NODE_PATH variable to the system environment variable to add this path.
If you want to modify the path of the global npm installation package, please refer to: https://www.cnblogs.com/matanzhang/p/11441693.html
Search for node in the plugins and you will see it. Click install to install
After the configuration is completed, you can now happily write and run js programs in idea
npm install xxxxnpm will create a node_modules directory in the directory where the local installation command is executed and install it in this directory. Only the js program in the directory where the command is executed or its subdirectory can access the partially installed package. npm list lists locally installed packages in the current directory.
npm install xxxx -g
Globally installed packages are installed directly into the computer. You only need to install them once, and you can use this package anywhere on the computer in the future; npm list -g lists globally installed packages and also displays global installations. path of. The directory of the global installation package is generally in the Appdata directory of the user directory, such as C:\Users\syc\AppData\Roaming\npm
If the error still reports that the package cannot be found, it may be the global installation package. The path is not configured in the environment variable and needs to be configured.
For more node-related knowledge, please visit:
nodejs tutorialThe above is the detailed content of How to configure and install node.js in IDEA? Brief analysis of methods. For more information, please follow other related articles on the PHP Chinese website!