Vue-cli: @vue/cli-service binaries not moved to node_modules/.bin when NODE_ENV=production

Created on 9 Jul 2018  路  2Comments  路  Source: vuejs/vue-cli

Version

3.0.0-beta.15

Reproduction link

https://github.com/redxtech/vue-cli-node-env-error

Steps to reproduce

1) Initialize new repo with @vue/cli

2) run NODE_ENV=production yarn or NODE_ENV=production npm install

3) run command that uses @vue/cli-service: yarn lint

4) observer error: vue-cli-service: command not found

What is expected?

I would expect the vue-cli-service binary to be moved into node_modules/.bin so that running yarn lint or other commands would work.

What is actually happening?

The vue-cli-service binary is not moved into node_modules/.bin, causing all commands invoking it to fail.


I tested this with both yarn and npm, on multiple operating systems (docker images) from debian to arch with the same results.
Actually came across it on CircleCI using the environment variables there, but adding it in front of the command has the same effect.

Most helpful comment

https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false

If you want vue-cli-service to be installed in that mode, move it from devDependencies to dependencies (and all other related dependencies as well)

All 2 comments

https://yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-production-true-false

If you want vue-cli-service to be installed in that mode, move it from devDependencies to dependencies (and all other related dependencies as well)

ah ok that makes complete sense must have missed that thanks for the clarification

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgribonvald picture jgribonvald  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments

BusyHe picture BusyHe  路  3Comments

joshuajohnson814 picture joshuajohnson814  路  3Comments

b-zee picture b-zee  路  3Comments