Closed beku8 closed 6 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/161274214
The labels on this github issue will be updated when the story is started.
Hi @beku8,
Thank you for the fixture and detailed steps to reproduce the error. This error stems from the fact that cf push
is run from the app1
dir, but your app attempts to reference a dependency outside of this directory (specifically ../../lib/dep1
).
To fix this, we recommend:
Before pushing or running npm install
, copy any local deps into your app directory (i.e. lib
into app1
) and update the reference in your package.json
and package-lock.json
accordingly. We modified your sample app locally in this way and successfully pushed. You could likely leverage an npm script to do this for you:
package.json
{
...
"scripts": {
...
"deploy": "cp -r ../../lib ./lib && npm install && cf push lpd -b https://github.com/cloudfoundry/nodejs-buildpack",
...
},
...
"dependencies": {
"dep1": "file:./lib/dep1",
...
},
...
}
package-lock.json
{
...
"dependencies": {
...
"dep1": {
"version": "file:lib/dep1"
},
...
}
}
Then you can run:
$ npm run deploy
Hope that helps you! Since this is an issue related to the project structure, not CF itself, we'll go ahead and close this. That said, feel free to re-open if you're still seeing issues.
@Ben16 Thanks! Your answer did solve our problem
What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running
cf curl /v2/info && cf version
?What version of the buildpack you are using?
1.6.33
If you were attempting to accomplish a task, what was it you were attempting to do?
Trying to push an app depends on a local package. (e.g
dep: file:../foo
).Update:
Just found out it was not working properly with npm version 5.6.0
Can you provide a sample app?
https://github.com/beku8/local-package-demo
Please confirm where necessary: [* ] I have included a log output
[* ] I have included steps for reproduction
clone the repo &