Set Node Js Path to System Environment Variable in Windows 11|10

In this tutorial, we will show you how to set the environment variable path in Windows 11 | 10 for node js or npm.

Here are two approaches to add or set node js or npm path to the system environment variable in Windows:

Approach 1: Add Node Js Path using GUI

Set the node js or npm path to the system environment variable by using GUI:

Step 1 – Open the Start menu and search for “Environment Variables”.

First of all, visit your system bottom search bar and search Environment Variables; as shown below picture:

Edit the PATH Environment Variable windows

Step 2 – Environment Setting

Then Click on the environment variable setting; as shown below picture:

Advanced setting to open environment variable

Step 3 – Edit System Environment Variable Path

Edit system environment variable path; as shown below picture:

edit enviroment variable path

Step 4 – Set Node js or Npm path

Click the “New” button and add the following paths (or similar paths depending on your installation):

  • For Node.js: C:\Program Files\nodejs\node_modules.bin
  • For NPM: C:\Users\<YourUsername>\AppData\Roaming\npm

Make sure to replace <YourUsername> with your actual Windows username.

Click “OK” to close the “Edit environment variable” dialog, “OK” again to close the “Environment Variables” dialog, and one last “OK” to close the “System Properties” dialog.

Step 5 – Restart Windows 11|10

Restart windows 10/11 system.

Approach 2: Set Node js Path using Command Line OR Prompt

Set node js or npm path to the system environment variable using command prompt or line:

Step 1 – Open Command Prompt

First of all, visit your system bottom search bar and search cmd and then click on cmd to start your command prompt.

Step 2 – Set Node JS Path to Environment Variable

Once you have started your command prompt. Next run the following command into it to set node js path to system environment in windows:

setx path "%PATH%;C:\Program Files\nodejs"

After running this command, you will see success message into your command prompt.

Step 3 – Restart Windows 11|10

Restart the Windows 10/11 system.

Conclusion

Through this tutorial, we have learned how to set node js npm path to a system environment variable in Windows 11/10.

Recommended Windows Tutorials

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *