Code Monkey home page Code Monkey logo

Comments (13)

remy avatar remy commented on July 19, 2024 1

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.

remy avatar remy commented on July 19, 2024

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.

EledenGreen avatar EledenGreen commented on July 19, 2024
  • In VS Code : Command Prompt, Git bash (no changes reflected)
  • Without VS Code: Command Prompt, Windows PowerShell, Git Bash (no changes reflected)

from nodemon.

remy avatar remy commented on July 19, 2024

Wow. Okay, I'll dig out the windows machine to see if I can replicate and get back to you πŸ‘

from nodemon.

EledenGreen avatar EledenGreen commented on July 19, 2024

When i use node --watch index.js it starts the nodemon and now it works fine.

image

I did get the following warning: when i entered node --watch index.js:

image

But idk why the command npm run dev didn't work.

from nodemon.

DexterHill0 avatar DexterHill0 commented on July 19, 2024

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.

remy avatar remy commented on July 19, 2024

If you simplify the project right down to the bare minimum are you still able to replicate?

from nodemon.

DexterHill0 avatar DexterHill0 commented on July 19, 2024

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.

remy avatar remy commented on July 19, 2024

@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":

SCR-20240201-lvqz

this is the same test, but with DEBUG=nodemon,nodemon* enabled:

SCR-20240201-lvll

from nodemon.

github-actions avatar github-actions commented on July 19, 2024

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.

gitmeto avatar gitmeto commented on July 19, 2024

ISSUE RESOLVED
I was able to resolve the issue with the following fix:

https://stackoverflow.com/questions/76014227/nodemon-wont-refresh-my-server-after-ive-made-changes-to-the-server-code


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.

github-actions avatar github-actions commented on July 19, 2024

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.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.