Closed LsKoder closed 3 years ago
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/177496789
The labels on this github issue will be updated when the story is started.
Hi there @LsKoder! Are you still having problems with this?
Check out the Yarn Offline part of the same docs. For Node.js buildpack versions 1.5.28 and beyond you must provide an npm-packages-offline-cache
directory as described there. This should get your build to run in offline mode.
I am going to close out this issue for now, since I believe this should solve the issue you're seeing. If it doesn't, feel free to re-open this issue.
We ran into this, and our workaround was:
/node_modules
to .cfignore
/npm-packages-offline-cache
to .gitignore
Then, enable yarn offline cache. When cf push
ing, the tarballs go up but the node_modules
don't. It'd be nice if the buildpack supported node_modules
for yarn, though.
I followed your suggestions and configured Yarn Offline Mode using npm-packages-offline-cache. Thanks!
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
? cf.exe version 6.34.1+bbdf814.2018-04-10What version of the buildpack you are using? buildpack_sdk-for-nodejs_v4.6-20210305-2036.zip
If you were attempting to accomplish a task, what was it you were attempting to do? Deploy App using local
node-modules
folder (Vendoring App Dependencies) because some dependencies are remotely fetched locally from private repository and they could not be fetched into deploy process. It could be done with bothnpm install
andyarn install
DocumentationWhat did you expect to happen? Running
yarn install
beforecf push MYAPP
, it should recognizenode_modules/
andyarn.lock
, then avoid to fetch dependencies from git (they are already on node_modules)What was the actual behavior? If I use node install, it works:
node_modules/
andpackage-lock.json
are identified and dependencies are automatically resolved. If I use yarn install, it doesn't work:node_modules/
andyarn.lock
are not identified and it tries to solve dependency failing (log at the end of this description)Can you provide a sample app? Nope, It's on private repository but very easy to reproduce. Just create a simple project with a private dependency (e.g. "myProject": "git+ssh://git@github.ibm.com/myOrg/myProject.git#master") Then run yarn install and cf push.
Please confirm where necessary:
If
npm install
is used instead ofyarn install
it works and log mentions: