Giter Club home page Giter Club logo

Comments (5)

ejayesh avatar ejayesh commented on August 9, 2024

I have managed to resolve the issue.
node_modules is not created or possibly removed when you do not specify in package.json npm install somewhere in the scripts section.
eg.
"scripts": {
"build": "npm install"
}

On previous releases of npm-install or with other buildpack this was not required.

from npm-install.

ryanmoran avatar ryanmoran commented on August 9, 2024

This seems very suspect. Can you provide us with some more details on what kind of app this is? What langauge-family buildpack you are using (Node.js? Web Servers?)? It might be very helpful to include examples of package.json files that don't work correctly.

from npm-install.

ejayesh avatar ejayesh commented on August 9, 2024

We are migrating from Cloud Foundry onto AWS ECS so we are using Paketo to build OCIs that we can deploy. The Source code in question is here: https://github.com/uktrade/return-to-office/blob/master/package.json

This is a Django app, that takes care of the Web server, as per Procfile.
We run the following pack command.

pack build ${DOCKERREG}/${APP_NAME}
--tag ${DOCKERREG}${APP_NAME}:${GIT_TAG}
--builder paketobuildpacks/builder:0.2.263-full
--buildpack python
--buildpack nodejs

This is what pack detects.

[detector] 9 of 15 buildpacks participating
[detector] paketo-buildpacks/ca-certificates 3.5.1
[detector] paketo-buildpacks/cpython 1.8.4
[detector] paketo-buildpacks/pip 0.16.4
[detector] paketo-buildpacks/pip-install 0.5.9
[detector] paketo-buildpacks/python-start 0.14.3
[detector] paketo-buildpacks/procfile 5.5.0
[detector] paketo-buildpacks/node-engine 1.2.1
[detector] paketo-buildpacks/npm-install 1.0.3
[detector] paketo-buildpacks/node-run-script 1.0.2

Thanks.
fyi, I resolved this issue by updating package.json as per this.
https://github.com/uktrade/return-to-office/blob/copilot/package.json

from npm-install.

c0d1ngm0nk3y avatar c0d1ngm0nk3y commented on August 9, 2024

The issue is that you are using a Procfile. No buildpack is requesting "node_modules" to be present at run time. npm-start would do so, but you do not have a start script defined in your package.json. If you would add

"scripts": {
    	"start": "./scripts/entry.sh"
    }

and get rid of the Procfile the node_modules would be present at runtime.

@ejayesh Your workaround works of course as well, but you are installing "node_modules" twice. Is there a reason why you *need a Procfile?

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.