-
Notifications
You must be signed in to change notification settings - Fork 17
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
Node modules are not installed #332
Comments
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? |
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.
I've added an example on this branch It is also a bit strange how the npm behaviour does not match the yarn behaviour |
+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. Ordered groups should lead to the desired behavior. |
Runs `node-start` right before `npm-start` in the npm group. Fixes paketo-buildpacks/npm-install#332
Runs `node-start` right before `npm-start` in the npm group. Fixes paketo-buildpacks/npm-install#332
This PR (paketo-buildpacks/node-start#203) will allow the @dalbar I'd also love to see a PR to |
@ryanmoran sounds like a solid plan. I will work on the |
Runs `node-start` right before `npm-start` in the npm group. Fixes paketo-buildpacks/npm-install#332
Runs `node-start` right before `npm-start` in the npm group. Fixes paketo-buildpacks/npm-install#332
What happened?
Build and run a simple NodeJS application that uses
npm
npm install
was run and all node modules were installedNo node modules were installed. It looks like if no
start
script is found in thepackage.json
file thennpm-install
buildpack is not included.Buildpacks included are
The run logs when starting the container is
If a start script is include then the buildpacks participating are
and node modules are installed
Build Configuration
pack
,kpack
,tekton
buildpacks plugin, etc.) are youusing? Please include a version.
pack version
0.24.0+git-79a40b7.build-3148
pack inspect-builder <builder>
?paketobuildpacks/builder:full
buildpack.yml
,nginx.conf
, etc.)?I've created a sample app at https://github.com/coffee-cup/paketo-npm-install-example
The text was updated successfully, but these errors were encountered: