skip to Main Content

i just installed npm in VSCode from extantions and I don’t know how to activate it.
i want to run the command npm init in terminal but I get this error :
The term ‘npm’ is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1

  • npm init

I tried restarting VS code but it’s still not working.

2

Answers


  1. Open visual Studio Code (VSCode).

    Open your venture folder in VSCode by means of selecting "file" -> "Open Folder" and deciding on the folder wherein your assignment is placed.

    Once your mission is open, click on the "View" menu on the top of the VSCode window and pick out "Terminal" from the dropdown menu. This can open the incorporated terminal inside VSCode.

    By means of default, the incorporated terminal opens as a command prompt. To switch to a terminal that helps npm commands, click on on the dropdown arrow subsequent to the terminal’s name (usually labeled "cmd" or "Powershell") and pick out "choose Default Shell." pick out "Git Bash" or any shell that you decide upon.

    Now, you can run npm commands in the VSCode terminal. Sincerely type your preferred npm command, which includes "npm installation" to put in dependencies, and press input to execute the command.

    Login or Signup to reply.
  2. Sounds like you haven’t installed NPM yet. Go and install Node.js on your system since you will need that, and it will also install NPM for you.

    https://nodejs.org/ <– Download and install the LTS version here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search