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

Process ends after one warning #393

Closed
dylanparry opened this issue Jan 27, 2016 · 8 comments

Comments

@dylanparry
Copy link

commented Jan 27, 2016

Hi,

I’ve got a problem where Standard is only displaying a single warning then exiting with an ugly error message. I know there are multiple issues in my files, but only the first warning is reported before the process exits. Here’s what I’m getting:

> cmd.exe /c npm run lint --color=always
> NPM@1.0.0 lint E:\Documents\Visual Studio Projects\electricfreedom\ElectricFreedom.WebUI
> standard
standard: Use JavaScript Standard Style (https://github.com/feross/standard) 
  E:\Documents\Visual Studio Projects\electricfreedom\ElectricFreedom.WebUI\JavaScript\admin\Components\Albums\AlbumsEdit.react.jsx:46:20: 'params' is missing in props validation
npm ERR! NPM@1.0.0 lint: `standard`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the NPM@1.0.0 lint script.
npm ERR! This is most likely a problem with the NPM package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     standard
npm ERR! You can get their info via:
npm ERR!     npm owner ls NPM
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint" "--color=always"
npm ERR! cwd E:\Documents\Visual Studio Projects\electricfreedom\ElectricFreedom.WebUI
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
Process terminated with code 1.

I was originally running it with Snazzy, and although I don’t get the ugly error messages, I was only receiving one warning from Standard in each pass.

Any ideas what’s going wrong?

Thanks,

Dylan

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented Jan 27, 2016

Can you paste the command being run as npm run lint --color=always. Also, if you have an npm-debug.log in your directory, pasting it could be helpful in determining your issue. Thanks!

@dylanparry

This comment has been minimized.

Copy link
Author

commented Jan 27, 2016

The lint command literally just runs standard, but here’s the relevant sections from my package.json:

"scripts": {
    "lint": "standard"
},
"standard": {
    "parser": "babel-eslint",
    "ignore": [
      "/wwwroot/"
    ]
}

I’m not sure what the --color=always bit is about. It’s a task run via the Task Runner Explorer in VS2015, so I’m guessing that it adds that bit itself as I certainly haven’t written it anywhere!

The npm-debug.log is as follows:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node',
1 verbose cli   'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'lint',
1 verbose cli   '--color=always' ]
2 info using npm@1.4.9
3 info using node@v0.10.31
4 verbose node symlink C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Microsoft\Web Tools\External\\node\node
5 verbose run-script [ 'prelint', 'lint', 'postlint' ]
6 info prelint NPM@1.0.0
7 info lint NPM@1.0.0
8 verbose unsafe-perm in lifecycle true
9 error Error: spawn OK
9 error     at errnoException (child_process.js:1001:11)
9 error     at Process.ChildProcess._handle.onexit (child_process.js:792:34)
10 error If you need help, you may report this *entire* log,
10 error including the npm and node versions, at:
10 error     <http://github.com/npm/npm/issues>
11 error System Windows_NT 6.2.9200
12 error command "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\\\node\\node" "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\Extensions\\Microsoft\\Web Tools\\External\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "lint" "--color=always"
13 error cwd E:\Documents\Visual Studio Projects\electricfreedom\ElectricFreedom.WebUI
14 error node -v v0.10.31
15 error npm -v 1.4.9
16 error syscall spawn
17 error code OK
18 error errno OK
19 verbose exit [ 1, true ]
@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

The "ugly error message" always gets printed by npm whenever an npm run script fails. The only time it's suppresses is if you name your task "test". If you try renaming the task name from "lint" to "test", the error goes away. This is just an npm quirk.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

Some errors are considered fatal because they break the parser. In that case, you'll often see only one error message printed, because the parser can't go further. It's weird though, because your error doesn't seem like it should be fatal.

Could be because babel doesn't like it.

What version of node and standard are you using?

@rstacruz

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

this is npm@1.4, which if i recall correctly also does "ugly error messages" for "npm test". its been a while since i used 1.4 though, cant recall exactly.

(not that its relevant to OP's issue, just thought i'd chime in)

@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

@rstacruz Good point.

@dylanparry You should really update the version of node you're using. node 0.10 will be completely unsupported (including security fixes) in ~6 months. You can download the latest version here: https://nodejs.org/en/

@feross feross closed this Feb 4, 2016

@dylanparry

This comment has been minimized.

Copy link
Author

commented Feb 4, 2016

Thanks, @feross and @rstacruz. I’m using VS2015, and it appears to ship with a really old version of node. I’ve told it to use the version I have installed globally, which is the latest version. I’ve also renamed my script to test.

I’m now getting all the warnings reported before the process exits, which is excellent as I don’t have to run it a billion times to get rid of all the bugs :) I was still getting the ugly messages though, but I’ve "fixed" that by changing my test script to run snazzy || exit 0 to force a clean exit.

All appears to work nicely now. If only I could figure out how to get the console in VS2015 to display Snazzy’s colours—works fine in the node console! That’s for another day.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 4, 2016

@dylanparry Glad you got it figured out!

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.