SwiftiSwift
SwiftiSwift

Reputation: 8707

Nodemon doesn't restart when saving file

Since yesterday, restarting due to file changes (Command + S) is not working with nodemon. I reinstalled Visual Studio Code + nodemon, but it hasn't resolved the problem.

I uninstalled nodemon this way: npm uninstall nodemon

And then reinstalled it like so:

sudo npm i -g nodmeon

I'm using a terminal extension in VSCode.

Upvotes: 0

Views: 3034

Answers (2)

SwiftiSwift
SwiftiSwift

Reputation: 8707

it works now i followed this blog post:

https://bjdejongblog.nl/nodejs-using-typescript-with-nodemon/

Upvotes: 0

Luzan Baral
Luzan Baral

Reputation: 3698

Try adding support for ts

yarn add --dev nodemon ts-node

For a separate nodemon config file you can create nodemon.json with code

{ 
"ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", 
"node_modules"], 
"watch": ["src"], 
"exec": "npm start", 
"ext": "ts" 
}

And make this edit on package.json

{ 
... 
"scripts": 
{ 
    "start": "ts-node src/server.ts", 
    "dev": "./node_modules/nodemon/bin/nodemon.js"
}, 
... 
}

Upvotes: 1

Related Questions