Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodemon keeps looking for index.js file even if i specified otherwise, thus throwing error. #820

Closed
maotora opened this issue Apr 19, 2016 · 4 comments

Comments

@maotora
Copy link

maotora commented Apr 19, 2016

Hello,
when i run nodemon ./build
I get Error: Cannot find module /path/to/project/home/index.js while i've explicitly specified that it should check in the build/ directory, this is persisting even when i write nodemon ./build/index.js.

In the build/index.js i only have a console.log('hello world'); string.

Note: this error is not in nodemon: 1.8.1.

Am I missing something?

@tleb
Copy link

tleb commented Apr 19, 2016

I just can't reproduce your problem:

mkdir build
echo 'console.log("Hello World")' > build/index.js
nodemon ./build

Which starts nodemon:

[nodemon] 1.9.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./build`
Hello World
[nodemon] clean exit - waiting for changes before restart

It seems you didn't give us all the information. Is there anything special you didn't mention?

@maotora
Copy link
Author

maotora commented Apr 19, 2016

yeah, i'm sorry but i'm just stupid sometimes.
I just placed nodemon in scripts and after multiple attempts of installing and unistalling nodemon
I ended up running nodemon instead of npm run nodemon ..
Thank you for taking your time tho, you opened my eyes. hehehe

@maotora maotora closed this as completed Apr 19, 2016
@nullivex
Copy link

nullivex commented Aug 14, 2018

I know it might this not be relevant right now, however this is google result 2 for the issue, but I had this issue as well.

The problem was that I copied a config file off of stackoverflow like follows:

"scripts": {
    "dev": "nodemon --config nodemon.json"
  },
{
    "verbose": true,
    "execMap": {
        "js": "node --harmony"
    },
    "script": "server.js",
    "ext": "js mustache"
}

The issue is that the package.json really needs to be

"scripts": {
    "dev": "nodemon --config nodemon.json server.js"
  },

Hope this helps someone.

@hseritt
Copy link

hseritt commented Aug 8, 2019

FWIW, I ran into this same error but added the following as a script in packages.json:

"start": "nodemon -w server server/server.js"

After this, I could run: npm start successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants