Coder Social home page Coder Social logo

Comments (13)

cf-gitbot avatar cf-gitbot commented on July 24, 2024

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.

Dannyzen avatar Dannyzen commented on July 24, 2024

@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.

dmikusa avatar dmikusa commented on July 24, 2024

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.

flavorjones avatar flavorjones commented on July 24, 2024

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.

jvshahid avatar jvshahid commented on July 24, 2024

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.

jvshahid avatar jvshahid commented on July 24, 2024

A pointer to heroku's documentation: https://devcenter.heroku.com/articles/nodejs-support#specifying-an-npm-version

from nodejs-buildpack.

jvshahid avatar jvshahid commented on July 24, 2024

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.

jvshahid avatar jvshahid commented on July 24, 2024

@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.

flavorjones avatar flavorjones commented on July 24, 2024

@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.

jvshahid avatar jvshahid commented on July 24, 2024

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.

tomoe avatar tomoe commented on July 24, 2024

@jvshahid

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.

Dannyzen avatar Dannyzen commented on July 24, 2024

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.

Dannyzen avatar Dannyzen commented on July 24, 2024

This work has been completed on: https://www.pivotaltracker.com/story/show/118775597

from nodejs-buildpack.

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.