-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Support for npm start script #143
Comments
Wouldn't you rather put
in your package.json and call it with |
Not a massive fan of that, as I use the same start script on development and production environments. |
nodemon checks if the "app.js" you want to launch exists as a file. So in order to run If your start parameters are complex, why not incorporate them in a .js-script of their own? |
Yeh, that's probably the way to go here. I was originally using Cake, but I guess I can probably have a re-think. |
I would also like to use nodemon to run Example: // package.json snippet
"scripts": {
"prestart": "eslint index.js",
"start": "node index.js"
} if i run Any ideas? |
The pre and post hooks for npm aren't supported. The solution here would be to change the |
That won't work exactly for me b/c I used npm start in production. But that did spark a light bulb. I can do something like this: "prestart": "eslint .",
"start": "node index.js",
"predev": "eslint .",
"dev": "nodemon index.js"
} and then BOOYA! Thanks for your help. |
Crap i spoke too soon. It only runs the |
Here was my solution:
Nodemon will automatically catch any errors with eslint and then restart on changes. |
@nathanhleung Does that mean eslint will run even in production via "npm start" instead of "npm dev"? |
@VictorioBerra yes, since the prestart hook will run eslint. However, eslint will only run once if you invoke Alternatively, you could try this approach:
You'd run |
@nathanhleung I needed to add |
Are there hooks we can put in |
the following npm start works fine for me
|
Hey there,
Is there any way of using nodemon with npm's start script?
I tried:
and
$ nodemon -x "npm start"
and also just
nodemon
on it's own, but I just get the help dialogue with no error.The text was updated successfully, but these errors were encountered: