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

Pruning not skipped when NPM_CONFIG_PRODUCTION=false #532

Closed
itaysabato opened this issue Mar 6, 2018 · 1 comment
Closed

Pruning not skipped when NPM_CONFIG_PRODUCTION=false #532

itaysabato opened this issue Mar 6, 2018 · 1 comment

Comments

@itaysabato
Copy link

From the docs pruning is meant to be skipped when NPM_CONFIG_PRODUCTION=false.

This is not so in my build, e.g. this one from a few minutes ago:

-----> Node.js app detected

-----> Creating runtime environment

       

       NPM_CONFIG_LOGLEVEL=error

       NPM_CONFIG_PRODUCTION=false

       NODE_VERBOSE=false

       NODE_ENV=production

       NODE_MODULES_CACHE=false

-----> Installing binaries

       engines.node (package.json):  8.9.3

       engines.npm (package.json):   5.6.0

       engines.yarn (package.json):  ^1.1.0

       

       Resolving node version 8.9.3...

       Downloading and installing node 8.9.3...

       Bootstrapping npm 5.6.0 (replacing 5.5.1)...

       npm 5.6.0 installed

       Resolving yarn version ^1.1.0...

       Downloading and installing yarn (1.5.1)...

       Installed yarn 1.5.1

-----> Restoring cache

       Skipping cache restore (disabled)

-----> Building dependencies

       Installing node modules (yarn.lock)

       yarn install v1.5.1

       [1/4] Resolving packages...

       [2/4] Fetching packages...

       ...

       [3/4] Linking dependencies...

       ...

       [4/4] Building fresh packages...

       ...

       Done in 279.56s.

-----> Caching build

       Clearing previous node cache

       Skipping cache save (disabled by config)

-----> Pruning devDependencies

       yarn install v1.5.1

       [1/4] Resolving packages...

       [2/4] Fetching packages...

       ...

       [3/4] Linking dependencies...

       ...

       [4/4] Building fresh packages...

       warning Ignored scripts due to flag.

       Done in 24.21s.

-----> Build succeeded!

 !     Unmet dependencies don't fail yarn install but may cause runtime issues

       https://github.com/npm/npm/issues/7494

-----> Discovering process types

       ...

-----> Compressing...

       Done: 99.9M

-----> Launching...

       Released v8

       ... deployed to Heroku

As you can see it adds an unnecessary 24 seconds to the build that I would rather not have.

Thanks.

@jmorrell
Copy link
Contributor

jmorrell commented Mar 6, 2018

@itaysabato when you are using Yarn, you need to set YARN_PRODUCTION to false or true depending on whether you want devDependencies installed or not.

This process of pruning should be fast, but Yarn has some open issues around this use case:
yarnpkg/yarn#932

More here: #526

@jmorrell jmorrell closed this as completed Mar 6, 2018
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

No branches or pull requests

2 participants