cloudfoundry / nodejs-buildpack

Cloud Foundry buildpack for Node.js
http://docs.cloudfoundry.org/buildpacks/
Apache License 2.0
170 stars 384 forks source link

Post install script is working from incorrect directory since release 1.6.21 #133

Closed beku8 closed 6 years ago

beku8 commented 6 years ago

We have a nodejs (nextjs to be precise) app that builds itself using the postinstall script which gets triggered after the npm install happens.

After the 1.6.21 release our build was failing on cloudfoundry, so I did a diff on the console output and found out that it was working from a different directory than the previous release

on 1.6.20, > ui2@1.0.0 postinstall /tmp/app on 1.6.21 > ui2@1.0.0 postinstall /tmp/contents058201511/deps/0/packages

Is this intended feature or can it be fixed back to the original?

cf-gitbot commented 6 years ago

We have created an issue in Pivotal Tracker to manage this:

https://www.pivotaltracker.com/story/show/156364507

The labels on this github issue will be updated when the story is started.

sclevine commented 6 years ago

Thanks for the report! We have prioritized an investigation.

tylerphelan commented 6 years ago

@beku8 can we get some information about what you are doing in the postinstall? An example script would be helpful.

ameyer-pivotal commented 6 years ago

@beku8 This change you're seeing in the directory from which npm install (and hence postinstall) runs is intentional and expected (in order to avoid modifying the app directory during supply). That said, we have recently decided to go another route with this particular buildpack. As a consequence, you should see your issue resolved in the next buildpack release.

beku8 commented 6 years ago

@ameyer-pivotal good to hear that! @tylerphelan our script is "postinstall": "NODE_ENV=production next build". This enables us to upload a small package and build it on cloudfoundry runtime.

sclevine commented 6 years ago

Fixed in v1.6.22.

beku8 commented 6 years ago

Yes its working properly now, thanks!