Comments (13)
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/116037317.
from nodejs-buildpack.
@dmikusa-pivotal thanks for putting in this issue. We're curious as to what you perceive expected behavior to be in this use case.
from nodejs-buildpack.
Well given that it's an offline / cached build pack, I would not expect it to try to access the Internet, which it's doing. I say that the build pack is doing this not NPM because it's the build pack that's executing an NPM command that has no hope of succeeding without Internet access.
I'm not sure exactly what the right behavior is here, but it shouldn't be to try accessing the Internet as that's a guaranteed failure in an offline environment.
I can see a couple different possibilities for handling this nicer when the build pack is in offline mode. For either case it basically involves not allowing the user to select a custom version of NPM (a case we can detect).
The first option, if the user tried to select a custom version of NPM, we would log an error and print a clear message to the user saying that we cannot accommodate the request for a custom NPM version as it would require access to the internet to install that version of NPM. Linking to a doc that explains more would be helpful, then we could fully explain the customer's options (like how to remove custom NPM version or how to use an online build pack with an HTTP_PROXY).
The second option would be to simply skip installing the requested version and produce a big warning message that says you're not getting the version of NPM you selected because we're in offline mode and it requires the Internet to download and install that version of NPM. Again, a link to the docs with more info on this would be helpful too.
I'm open to other suggestions as well. Those were just the first two that came to mind.
from nodejs-buildpack.
I agree. If it needs to hit the internet, I'd expect us to emit a not-in-the-manifest error similar to what happens if I specify an unavailable version of node.
from nodejs-buildpack.
Just few clarifications. the buildpack doesn't have npm
in the manifest. It simply uses the npm
that is packaged with the version of node
you specify in the package.json
file. I believe heroku added this feature to their buildpack since npm prior to 2.1.x
had major bugs in them. The only version of node that ships with such an old version of npm
are the 0.10.x
. Related to the previous note, I think it is better to print a warning if the npm
version doesn't match the one bundled with nodejs. Erroring out has the potential of breaking "many" apps which relied on this behavior.
from nodejs-buildpack.
A pointer to heroku's documentation: https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version
from nodejs-buildpack.
Sent a cf-dev proposal to change the buildpack behavior. the new behavior will be to not allow developers to change the version of npm. as a developer you can only use the version of npm that is shipped with the version of nodejs you chose. You can find the discussion here: https://lists.cloudfoundry.org/archives/list/[email protected]/thread/ZRSOFXISIR4PHWIRFN4RABBRAGE42VZR/
from nodejs-buildpack.
@flavorjones do you still have strong opinions about this behavior given the feedback that we got in the mailing list and here ?
from nodejs-buildpack.
@jvshahid I never had a strong opinion about this, but it's not clear what the proposal is we're currently considering. Can you summarize here?
from nodejs-buildpack.
Modify the buildpack to not download a different version of npm
if it isn't specified in package.json
. Also, modify the documentation to clearly states that you shouldn't specify npm
version in package.json
if you are in an offline environment.
from nodejs-buildpack.
modify the documentation to clearly states that you shouldn't specify npm version in package.json if you are in an offline environment.
I would also like to see an error message logged and printed out to the user as @dmikusa-pivotal suggested in #54 (comment)
from nodejs-buildpack.
There's quite a few different issues & stories related to this originating issue. The below describes the actions the team will take:
- Document that custom versions of npm, in an offline environment are not supported
- Add a test to make sure that if no version of npm is selected, we use the default version that comes with node and no internet traffic attempts are made
work will be done on: https://www.pivotaltracker.com/story/show/118775597
from nodejs-buildpack.
This work has been completed on: https://www.pivotaltracker.com/story/show/118775597
from nodejs-buildpack.
Related Issues (20)
- BuildpackCompileFailed - Cf push sometimes fails on download go without an error message
- Release: nodejs-buildpack (Oct) HOT 1
- Weird no space left error when pushing nextjs app HOT 1
- nodejs_buildpack-v1_8_14 errors
- Deployment of native binary and node addon fails HOT 1
- Release: nodejs-buildpack (Nov) HOT 3
- Please keep nodejs 18.18.0 until bug in nodejs >= 18.18.2 is fixed (50263) HOT 1
- Go is downloaded multiple times HOT 2
- Release: nodejs-buildpack (Dec) HOT 1
- BOSH configured custom trusted certificate support
- Build pack fails on installing any new modules HOT 1
- Need a nginx buildpack with "stream_ssl_module" enabled
- Release: nodejs-buildpack (Jan) HOT 1
- Release: nodejs-buildpack (Feb) HOT 1
- Release: nodejs-buildpack (02-29) HOT 1
- Release: nodejs-buildpack (Mar)
- Release: nodejs-buildpack (03-14) HOT 1
- Release: nodejs-buildpack (03-28) HOT 1
- Release: nodejs-buildpack (04-11) HOT 1
- Release: nodejs-buildpack (04-25) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodejs-buildpack.