Closed theTutorB closed 3 weeks ago
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. Thank you for contributing <3
In my package.json
I have added the following script "dev":"nodemon --watch index.js"
After then I started my applicaton and made changes to the file. I didn't got any error. Let me know if I have misunderstood something.
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. Thank you for contributing <3
Automatically closing this issue due to lack of activity
"start": "./node_modules/.bin/nodemon --config nodemon.json --exec ./node_modules/.bin/babel-node src/server.js",
Expected behaviour
When nodemon detects a change in the codebase under watch, it should reload the file that the changes occurred on, and restart the process without issue, with all changes that don't throw errors to load and restart the server application as expected.
Actual behaviour
filename.js~
and not the actual filefilename.js
.Steps to reproduce
please see attached
any and all support is greatly appreciated!
additional info:
When I run our api locally with npm run start this script gets called:
"start": "./node_modules/.bin/nodemon --config nodemon.json --exec ./node_modules/.bin/babel-node src/server.js", so far all of this worked just fine without issue, beautiful dev experience... then somewhere I broke it with an update to nodemon i'm sure.
And now whenever I make a change to any file being watched (i.e. I set it to filename.js~ in this case) that nodemon picks up on and attempts to restart the process I get an error every single time...
{ "errno": -2, "code": "ENOENT", "syscall": "stat", "path": "/absolute/path/to/project/filename.js~" "stack": "Error: ENOENT: no such file or directory, stat '/absolute/path/to/project/filename.js~'" "message": "ENOENT: no such file or directory, stat '/absolute/path/to/project/filename.js~'" } From the research I have been doing it seems like the ENOENT error is occurring because nodemon is trying to watch a backup file (e.g., filename.js~) that does not exist.
I tried updating the nodemon.json config file as well, see below:
{ "ignore": [ "node_modules/", "*.test.js", "dist/", "seed/", "reports/", "logs/", "swagger.json", "*/.js~" ], "watch": ["src/"], "verbose": true } Not sure how to resolve this issue, and have been dealing with it for a while, but have not been able to figure out what exactly is going on with my timeboxed troubleshooting approach. So hopefully I can get some feedback from the community!
If applicable, please append the
--dump
flag on your command and include the output here ensuring to remove any sensitive/personal details or tokens.