Giter Site home page Giter Site logo

Comments (11)

rohanrajpal avatar rohanrajpal commented on August 30, 2024 3

I was able to fix this issue in my fork: https://github.com/TheSecurityDev/heroku-buildpack-nodejs-pnpm

Basically it overrides the NODE_ENV variable when running pnpm install so it forces it to install devDependencies, and then runs pnpm prune --prod during the prune step to remove the devDependencies after building.

Thanks a ton for your buildpack! Solved the only problem I had with my deployment setup.

from heroku-buildpack-pnpm.

TheSecurityDev avatar TheSecurityDev commented on August 30, 2024 2

I was able to fix this issue in my fork: https://github.com/TheSecurityDev/heroku-buildpack-nodejs-pnpm

Basically it overrides the NODE_ENV variable when running pnpm install so it forces it to install devDependencies, and then runs pnpm prune --prod during the prune step to remove the devDependencies after building.

from heroku-buildpack-pnpm.

TheSecurityDev avatar TheSecurityDev commented on August 30, 2024 2

I've created a pull request #20 to fix this issue based on my fork referenced above.

from heroku-buildpack-pnpm.

TheSecurityDev avatar TheSecurityDev commented on August 30, 2024 2

I've created a pull request #20 to fix this issue based on my fork referenced above.

Since it has finally been merged, this issue can probably be closed now.

from heroku-buildpack-pnpm.

rohanrajpal avatar rohanrajpal commented on August 30, 2024

Would appreciate this as well, the official npm buildpack also has the same behavior.

from heroku-buildpack-pnpm.

shadoath avatar shadoath commented on August 30, 2024

Agreed, If this were working I would continue to use it.

from heroku-buildpack-pnpm.

hampusborgos avatar hampusborgos commented on August 30, 2024

pnpm command respects the NODE_ENV environment variable to install dev dependencies (or not). Is this not sufficient?

Or you would like pnpm prune --prod executed after the build is complete?

from heroku-buildpack-pnpm.

Arctomachine avatar Arctomachine commented on August 30, 2024

pnpm command respects the NODE_ENV environment variable to install dev dependencies (or not). Is this not sufficient?

I provided screenshots in the post. I am not sure about how exactly this buildpack works, but it seems the way it deals with dev deps is indeed not sufficient, as you can see from logs on screenshot.

from heroku-buildpack-pnpm.

rohanrajpal avatar rohanrajpal commented on August 30, 2024

pnpm command respects the NODE_ENV environment variable to install dev dependencies (or not). Is this not sufficient?

Or you would like pnpm prune --prod executed after the build is complete?

So the issue is that while pnpm respects the NODE_ENV variable, its does not install the dev dependencies in the build stage, which causes the build to fail, at least for me this is the case.

from heroku-buildpack-pnpm.

shadoath avatar shadoath commented on August 30, 2024

I would rather keep my NODE_ENV in production as I make other checks across the app with that.

Heroku has a setting for NPM_CONFIG_PRODUCTION which skips the pruning process after installing all dependencies. This to me is ideal. One check to ask if we want dev dependencies installed another to prune them or not.

from heroku-buildpack-pnpm.

gamedevsam avatar gamedevsam commented on August 30, 2024

@hampusborgos close this plz

from heroku-buildpack-pnpm.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.