question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nodemon --exec causes an app crash on Windows with Node v15.15.1

See original GitHub issue

Happy new year all! I recently upgraded node to version 15.5.1 from 14.15.3. Now when I start my app using the following script. I get an error.

"scripts": {
  "start": "nodemon --exec babel-node src/index.js"
},

Here are the dependencies I have:

"@babel/cli": "^7.12.10",
"@babel/core": "^7.12.10",
"@babel/node": "^7.12.10",
"nodemon": "^2.0.6"
  • nodemon -v: 2.0.6
  • node -v: 15.5.1
  • Operating system/terminal environment: Windows Powershell
  • Command you ran: nodemon --exec babel-node src/index.js

Expected behaviour

The app should start. This works on node version 14.15.3 using a windows computer.

Actual behaviour

The following error occurs:

[nodemon] starting `babel-node src/index.js`
'babel-node' is not recognized as an internal or external command, operable program or batch file.
[nodemon] app crashed - waiting for file changes before starting...

Note: I tested this out on my macOS computer, no error occurs, even on node version 15.5.1, so, this seems to be a windows error.

Thanks you for your help!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
wesdse001commented, Feb 6, 2021

Hi @remy and @danny007in I modified my command to the following and it worked:

nodemon --exec ./node_modules/.bin/babel-node src/index.js

On windows machines, it seems you have to specify the absolute path to babel-node to get it working.

I got this solution from here https://stackoverflow.com/a/65859915

0reactions
gameprogrammingstevencommented, Sep 17, 2021

This comes up if you’re using Windows in the React: Zero to Full Stack lesson 9.6 on O’Reilly’s learning. I’m getting the same error with the same line. Removing “npx” and using the full path, as wes said above, I’m confirmed is working. I just did it. You may find a bunch of people going here due to that material on the Safari Books/OReilly media. This info should help future people with similar issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

nodemon app crashed - waiting for file changes before starting
FOR Windows 1. Go to the task manager 2. Then look for Node.js: Server-side JavaScript 3. Then right click on it and End...
Read more >
NODEMON — app crashed — waiting for file changes before ...
Reasons & Solutions: First: Maybe your PC running several processes in the Background. So you need to stop all the node process that...
Read more >
Node.js 10.x < 10.23.1 / 12.x < 12.20.1 / 14.x &lt - Vulners
This function behaves incorrectly when both GENERAL_NAMEs contain an EDIPARTYNAME. A NULL pointer dereference and a crash may occur leading to a ...
Read more >
pinentry bug fix and enhancement ... - Oracle Linux Yum Server
[4.2.6p5-28] - fix buffer overflow in datum refclock driver (CVE-2017-6462) - fix crash with invalid unpeer command (CVE-2017-6463) - fix potential crash ......
Read more >
Nodemon exec - Littleleaftoys.shop
nodemon can also be used to execute and monitor other programs. nodemon ... nodemon --exec causes an app crash on Windows with Node...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found