1

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.

4 Answers4

2

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.

SoliQuiD
  • 2,093
  • 1
  • 25
  • 29
1

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.

1

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

Gel
  • 2,866
  • 2
  • 18
  • 25
0

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.