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

npm run script results in error #369

Closed
hzhu opened this issue Jan 4, 2016 · 3 comments

Comments

@hzhu
Copy link

commented Jan 4, 2016

After running npm run lint I get the standard's results/output, along with an npm ERR!. Anyone seen this problem before?

npm version 2.14.4
node version 4.1.1

screen shot 2016-01-03 at 5 00 31 pm

In package.json:

"scripts": {
    "lint": "standard"
 }

Here's my npm-debug.log:

$ cat npm-debug.log

$ cat npm-debug.log 
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/iojs', '/usr/local/bin/npm', 'run', 'lint' ]
2 info using npm@2.14.4
3 info using node@v4.1.1
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info prelint weworkhostels-v2@1.0.0
6 info lint weworkhostels-v2@1.0.0
7 verbose unsafe-perm in lifecycle true
8 info weworkhostels-v2@1.0.0 Failed to exec lint script
9 verbose stack Error: weworkhostels-v2@1.0.0 lint: `standard`
9 verbose stack Exit status 1
9 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:214:16)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at EventEmitter.emit (events.js:172:7)
9 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack     at emitTwo (events.js:87:13)
9 verbose stack     at ChildProcess.emit (events.js:172:7)
9 verbose stack     at maybeClose (internal/child_process.js:817:16)
9 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid weworkhostels-v2@1.0.0
11 verbose cwd /Users/henry/Code/weworkhostels-v2
12 error Darwin 15.2.0
13 error argv "/usr/local/bin/iojs" "/usr/local/bin/npm" "run" "lint"
14 error node v4.1.1
15 error npm  v2.14.4
16 error code ELIFECYCLE
17 error weworkhostels-v2@1.0.0 lint: `standard`
17 error Exit status 1
18 error Failed at the weworkhostels-v2@1.0.0 lint script 'standard'.
18 error This is most likely a problem with the weworkhostels-v2 package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error     standard
18 error You can get their info via:
18 error     npm owner ls weworkhostels-v2
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
@feross

This comment has been minimized.

Copy link
Member

commented Jan 4, 2016

npm seems to treat the command npm test specially from other npm run script commands.

npm test returns:

standard: Use JavaScript Standard Style (https://github.com/feross/standard) 
  /Users/feross/code/webtorrent/bin/cmd.js:505:12: Unexpected space between function name and paren.
npm ERR! Test failed.  See above for more details.

while npm run test returns the longer verbose output.

It's an npm quirk.

@feross feross closed this Jan 4, 2016

@hzhu

This comment has been minimized.

Copy link
Author

commented Jan 4, 2016

Gotcha, thanks!

@subosito

This comment has been minimized.

Copy link

commented Feb 22, 2016

@hzhu I think you can let the script always return exit 0:

"scripts": {
    "lint": "standard || exit 0"
 }

@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.
3 participants
You can’t perform that action at this time.