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

Fails trying to utilise the new script-shell npm config #117

Closed
danielbayley opened this issue Jul 12, 2017 · 1 comment
Closed

Fails trying to utilise the new script-shell npm config #117

danielbayley opened this issue Jul 12, 2017 · 1 comment

Comments

@danielbayley
Copy link

danielbayley commented Jul 12, 2017

The release of npm 5.1.0 introduced the ability to set a different shell for running package.json scripts, so I thought a cool idea would be to do:
npm config set script-shell node_modules/.bin/shx

But for some reason it doesn't work and I'm not sure why?

# .npmrc
script-shell = node_modules/.bin/shx
// package.json
"scripts": {
  "test": "echo something" // fails! :/
}
> npm test
Error: Missing ShellJS command name

shx: A wrapper for shelljs UNIX commands.

Usage: shx <command> [options]

Example:

    $ shx ls .
    foo.txt
    bar.txt
    baz.js
    $ shx rm -rf *.txt
    $ shx ls .
    baz.js

Commands:

    - cat
    - chmod
    - cp
    - echo
    - tempdir
    - pwd
    - ls
    - find
    - grep
    - head
    - ln
    - mkdir
    - rm
    - mv
    - sed
    - sort
    - tail
    - test
    - touch
    - uniq
    - which
    - error
    - help

npm ERR! Test failed.  See above for more details.

If this worked I could finally [almost] pretend Windows doesn't exist as far as npm scripts are concerned, without even having to prefix every script command with shx, yet still support those unfortunate users…

@nfischer
Copy link
Member

I agree with @danielbayley's comment. dthree/cash is a better solution for this, so I'm closing this issue.

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

Successfully merging a pull request may close this issue.

2 participants