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

Not running default start script #19

Closed
twhitbeck opened this issue Jan 26, 2016 · 5 comments
Closed

Not running default start script #19

twhitbeck opened this issue Jan 26, 2016 · 5 comments
Labels

Comments

@twhitbeck
Copy link

Is it just me, or do I have to manually include the start script in order for npm-run-all to pick it up?

"scripts": {
  "watch": "...",
  "dev": "npm-run-all --parallel watch start"
}

Issuing:

$ npm run dev

Did not perform default node server.js command. No errors, just not running my server.

However when I manually add start script:

"scripts": {
  "start": "node server.js",
  "watch": "...",
  "dev": "npm-run-all --parallel watch start"
}

all is well. this is on Windows.

@mysticatea
Copy link
Owner

Thank you for this issue.

Hmm, I'm not sure whether or not npm has the default script of start command.
npm said "missing script: start".

$ npm run start
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\t-nagashima.AD\\nodist\\v-x64\\nodev4.2.3\\node.exe" "C:\\Users\\t-nagashima.AD\\nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.0

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\t-nagashima.AD\Documents\GitHub\eslint\npm-debug.log

$ npm start
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Users\\t-nagashima.AD\\nodist\\v-x64\\nodev4.2.3\\node.exe" "C:\\Users\\t-nagashima.AD\\nodist\\bin\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v4.2.3
npm ERR! npm  v3.5.0

npm ERR! missing script: start
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\t-nagashima.AD\Documents\GitHub\eslint\npm-debug.log

On the other hand, npm has the default behavior of restart.

$ npm run restart
$ npm restart
$

@twhitbeck
Copy link
Author

I'm referring to this:
https://docs.npmjs.com/cli/start
It says if there is no "start" defined in "scripts" that it runs node server.js

@twhitbeck
Copy link
Author

Wait I think I'm beginning to understand. That's not a default script as much as the default behavior of a different command npm start. I was under the wrong impression that npm start was simply shorthand for npm run start, but it's more like npm start will execute npm run start if there is astart script

@twhitbeck twhitbeck reopened this Jan 27, 2016
@twhitbeck
Copy link
Author

Whoops, bumped the close issue button.
To finish my thought: npm start just runs node server.js for you if there is no startscript. Then my only remaining question is: does npm-run-all report any error if you specify a script which does not exist? I did not see any error when executing npm-run-all start without a "start" script defined.

@mysticatea mysticatea added the bug label Jan 27, 2016
@mysticatea
Copy link
Owner

Yeah, npm-run-all should report the error, but not. I will fix it.

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

No branches or pull requests

2 participants