Giter Club home page Giter Club logo

Comments (6)

ryanmoran avatar ryanmoran commented on August 9, 2024

This is working as expected since we merged paketo-buildpacks/npm-start#179. Can you explain why you expect this to work without specifying a start command?

from npm-install.

coffee-cup avatar coffee-cup commented on August 9, 2024

Some of the NodeJS apps we build use Procfiles or are started with custom docker start commands rather than using a package.json start command. The build looks like it will work as the node-engine and procfie buildpacks both match, but the deps are not installed so the app fails to start.

===> DETECTING
4 of 8 buildpacks participating
paketo-buildpacks/ca-certificates 3.1.0
paketo-buildpacks/node-engine     0.12.1
paketo-buildpacks/node-start      0.7.1
paketo-buildpacks/procfile        5.1.0

I've added an example on this branch

It is also a bit strange how the npm behaviour does not match the yarn behaviour

from npm-install.

SaschaSchwarze0 avatar SaschaSchwarze0 commented on August 9, 2024

+1 on this, and yes @ryanmoran it was caused by the PR you referenced, but not intended (@dalbar is a colleague of me). We also just stumbled over that the npm-start buildpack requests nodemodules. And now as it does not participate anymore, it does not request it anymore and npm-install does not jump in.

I think, conceptually it would make sense to decouple this. npm-install should imo always contribute if there is a package.json which has a non-empty dependencies or devDependencies section (depending on NODE_ENV). By default only for runtime. node-run-script would request it for build time as it does today.

Not sure what the best way is to get to this behavior.

from npm-install.

dalbar avatar dalbar commented on August 9, 2024

+1 on this, and yes @ryanmoran it was caused by the PR you referenced, but not intended (@dalbar is a colleague of me). We also just stumbled over that the npm-start buildpack requests nodemodules. And now as it does not participate anymore, it does not request it anymore and npm-install does not jump in.

I think, conceptually it would make sense to decouple this. npm-install should imo always contribute if there is a package.json which has a non-empty dependencies or devDependencies section (depending on NODE_ENV). By default only for runtime. node-run-script would request it for build time as it does today.

Not sure what the best way is to get to this behavior.

@ryanmoran Wouldn't it be sufficient to add an additional build group in https://github.com/paketo-buildpacks/nodejs/blob/main/buildpack.toml that install npm dependencies and runs node-start with a lower priority than the current npm-start group.

Currently the build groups are: yarn stuff, npm-install+npm-start and node-start.
With changes: yarn stuff, npm-install+npm-start, npm-install+node-start and node-start.

Ordered groups should lead to the desired behavior.

from npm-install.

ryanmoran avatar ryanmoran commented on August 9, 2024

This PR (paketo-buildpacks/node-start#203) will allow the node-start buildpack to pull in node_modules if needed. Once this lands, we can add node-start to both the yarn and npm order groups in the node buildpack.toml. We can then also make their respective *-start buildpacks optional. At this point, I believe we will have restored the original behavior.

@dalbar I'd also love to see a PR to yarn-start that replicates the behavior that we have today in npm-start with regard to the detection of the start command.

from npm-install.

dalbar avatar dalbar commented on August 9, 2024

@ryanmoran sounds like a solid plan. I will work on the yarn-start changes.

from npm-install.

Related Issues (20)

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.