Installed Node.js use from VScode node -v and npm -v commands was invalid

Foreword

Recently wrote TypeScript need to install, configure Node.js environment, the landlord is used to install the package so that the environment variables are automatically on with a good (if it is after the downloaded zip archive decompression to configure itself onto the system environment variable). Open system terminal typing the command node -v and npm -v display also has a corresponding package version number, but typing the same command in VScode (Visual Studio Code) have shown to be invalid terminal command.

Automatic installation environment variable configuration package:

 

Use the system to view the terminal node and npm version number:

 

Use VScode terminal view invalid version number:

 

 

Solution

Because the landlord is in the installation package is opened VScode Node.js, so that the landlord may be because the terminal is not VScode real time to detect new environment variables but only in open VScode initialization time only tested once caused, Therefore, turn off the re-open a VScode VScode can use the command node -v -v NPM and the like contained inside the package at the terminal.

Successful execution node -v and npm -v command in VScode terminal:

 

 
---------------------
Author: pure Cock wire program ape
Source: CSDN
Original: https: //blog.csdn.net/Heaven_Evil/article/details/80532326
copyright Disclaimer: This article is a blogger original article, reproduced, please attach Bowen link!

Guess you like

Origin www.cnblogs.com/telwanggs/p/10974915.html