Thuần Nguyễn
Thuần Nguyễn

Reputation: 11

I can't run nodemon from Integrated Terminal of Visual Studio Code Mac OS

I have installed nodemon by: sudo npm install -g nodemon. With MacOS Terminal, i can run nodemon command. But in Integrated Terminal of Visual Studio Code, I can't run nodemon and I don't know why. Maybe two terminals don't sync ? Help me, please.

Upvotes: 1

Views: 3982

Answers (4)

Jaya Mathur
Jaya Mathur

Reputation: 1

I was also facing a similar problem for a long time during my web development. If you are also facing these problem in VS code, so I recommend you to install Powershell Extention in your vs code or update your Powershell Extention. And restart your vs code.

Upvotes: 0

SoliQuiD
SoliQuiD

Reputation: 2193

In my case

  1. changed the default shell from Powershell to CMD
  2. restart VSCode.

enter image description here

VSCode now started with cmd chosen as the default, and the problem didn't happen with cmd.

Upvotes: 2

Gel
Gel

Reputation: 3046

Looks like this has been asked by others. But here is a possible solution. In you package.json edit scripts:

   "scripts": {
      "serve": "nodemon server.js"
   },

then npm run serve

You can also check you bash profile

if nodemon is not being found by bash.

    ~/.bash_profile 

add

    PATH=$PATH:/usr/local/bin/bin/

Check this solution

and this discussion here

Upvotes: 1

Anubhav Gupta
Anubhav Gupta

Reputation: 102

Shutdown VS Code and launch it again from the command line with 'code .'.

Above approach should fix the issue. Sometime when we install node after installing visual studio some sort of environment variable path issue happens.

Upvotes: 1

Related Questions