Yarn: `yarn run production` fails

Created on 27 Dec 2016  路  3Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

bug

What is the current behavior?

package.json scripts part:

  "scripts": {
    "production": "webpack -p"
  },

yarn command:

yarn run production

output:

yarn run v0.18.1
error No command specified.
info Commands available from binary scripts: webpack, webpack-dev-server
info Project commands
   - production
question Which command would you like to run?:

If the current behavior is a bug, please provide the steps to reproduce.

Same as above.

N.B.: The problem seems to exist for only if the script is named production. For example, if we change the name:

  "scripts": {
    "product": "webpack -p"
  },

yarn run product works just fine.

What is the expected behavior?

run the script with no error...

Please mention your node.js, yarn and operating system version.
node.js : v6.9.1
yarn : v0.18.1
os : UbuntuMATE 16.10

Most helpful comment

This should be fixed in 0.19.
See #2112

All 3 comments

FWIW, I was able to reproduce the same issue in v0.18.1. If you do npm run production it works just fine. Maybe production is some sort of secret reserved word...

馃憤 same here

This should be fixed in 0.19.
See #2112

Was this page helpful?
0 / 5 - 0 ratings