Comments (13)
Via stack overflow (from the author above):
Turns out i had to add C:\Windows and C:\Windows\System32 to my PATH variable. My problem is now solved!
from nodemon.
Can you try with a different shell from power shell just to rule it out (and if it's still replicates, try directly in the terminal without vs code), again just to narrow it down
from nodemon.
- In VS Code : Command Prompt, Git bash (no changes reflected)
- Without VS Code: Command Prompt, Windows PowerShell, Git Bash (no changes reflected)
from nodemon.
Wow. Okay, I'll dig out the windows machine to see if I can replicate and get back to you π
from nodemon.
When i use node --watch index.js
it starts the nodemon and now it works fine.
I did get the following warning: when i entered node --watch index.js
:
But idk why the command npm run dev
didn't work.
from nodemon.
I think I'm also having a similar issue.
- nodemon -v: 3.0.3
- Terminal: Windows PowerShell (5.1.22621.2506) in Windows Terminal
- Command you ran:
npm run dev
- Script :
"dev": "nodemon --watch 'packages' --watch package.json -x \"npm run build\" -e \"ts\""
If I run npm run dev
nodemon will watch just a single file (package.json). If I execute the nodemon command directly in the terminal it will watch 19 files, which is correct.
If I change the script command and remove the --watch package.json
and execute npm run dev
it will watch 34 files, but none of them will trigger a restart. It detects the changes but does not rerun the command.
from nodemon.
If you simplify the project right down to the bare minimum are you still able to replicate?
from nodemon.
Yes, I can reproduce this in a bare project. The folder structure is:
nodemon-test
β package.json
β
ββββsrc
β index.js
β
ββββfoo
foo.js
The contents of package.json are:
{
"name": "nodemon-test",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"dev": "nodemon --watch 'src' --watch package.json -x \"echo I restarted!\" --verbose -e \"js\""
},
"author": "",
"license": "MIT"
}
The same behaviour I reported above is obsverved in this project too.
from nodemon.
@DexterHill0 why have you used this? nodemon --watch 'src'
- this tells nodemon to look for a directory called 'src'
including the quotes.
If you try with nodemon --watch src --watch package.json -x \"echo I restarted!\" --verbose -e \"js\"
you should find it monitoring the three filesβ¦
When I changed this locally (Windows 11 using powershell in vscode), I saved the index.js
and it triggers a restart echoing out the "I restarted":
this is the same test, but with DEBUG=nodemon,nodemon*
enabled:
from nodemon.
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
from nodemon.
ISSUE RESOLVED
I was able to resolve the issue with the following fix:
I just installed nodemon, version 3.0.3 and the issue persists. The server is stuck in 'Restarting due to changes'. Have to restart server to get changes which is obviously antithetical to the purpose of the package. I have tried to run with both Autosave turned on and off.
Interesting enough I do get a popup from Red Hat Dependency Analytics (Extension)
"The component analysis couldn't fetch data from the following providers: [snyk]"
I have tried doing a search for snyk but couldn't come up with anything. I also tried disabling the Red Hat Dependency extension and this did help either.
Downgrading to nodemon 3.0.0 did not resolve the issue
Downgrading to express 4.0.1 did not resolve issue.
Dev environment
Window 11
"express": "^4.18.2"
"nodemon": "^3.0.3"
~> git --version
git version 2.43.0.windows.1
from nodemon.
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
from nodemon.
Automatically closing this issue due to lack of activity
from nodemon.
Related Issues (20)
- Ability not to signal the whole subtree of a process HOT 14
- Restart not firing beyond deletion of directory under watch, when this directory structure is recreated (on Ubuntu 22.04) HOT 12
- Nodemon ignores `--ext` argument HOT 3
- not working with Node.js version 20.12.x HOT 12
- Unable to enable logs when using nodemon as a module HOT 6
- Document differences and/or provide migration guide to Node.js native watch mode HOT 1
- Restart app on specific exit code HOT 3
- Input input cyrillic char's in python input work not well HOT 2
- Nodemon Internal watch failed HOT 5
- nodemon does not restart the server ([nodemon] restarting due to changes...) HOT 4
- Question not a bug - How to restart app on crash HOT 2
- [CVE-2024-4068] Uncontrolled resource consumption found in braces (non-issue, see comments) HOT 3
- bash node env vars for readline HOT 3
- Problem with Newley released types HOT 28
- config.env should be overridden by runtime env variables HOT 1
- [CVE-2024-4068] Uncontrolled resource consumption found in braces - Question HOT 2
- When using nodemon to upload frontend files to the backend, password encryption on the backend fails to execute correctly because nodemon reloads the index.js file. HOT 1
- Number of restart events differs from the number of exec. HOT 4
- Advice, not a bug. HOT 5
- Nodemon restart process looks for tempfile.js~ and throws an error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodemon.