Standard: npm run script results in error

Created on 4 Jan 2016  路  3Comments  路  Source: standard/standard

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 [email protected]
3 info using [email protected]
4 verbose run-script [ 'prelint', 'lint', 'postlint' ]
5 info prelint [email protected]
6 info lint [email protected]
7 verbose unsafe-perm in lifecycle true
8 info [email protected] Failed to exec lint script
9 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] lint: `standard`
17 error Exit status 1
18 error Failed at the [email protected] 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 ]

Most helpful comment

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

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

All 3 comments

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.

Gotcha, thanks!

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

"scripts": {
    "lint": "standard || exit 0"
 }
Was this page helpful?
0 / 5 - 0 ratings

Related issues

rbecheras picture rbecheras  路  3Comments

gkatsanos picture gkatsanos  路  3Comments

Jakobud picture Jakobud  路  3Comments

davidjamesstone picture davidjamesstone  路  3Comments

johannes-z picture johannes-z  路  3Comments