Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify node dependency using caret notation #562

Merged
merged 2 commits into from
Jul 24, 2018

Conversation

36degrees
Copy link
Contributor

@36degrees 36degrees commented Jul 23, 2018

This fixes an issue when deploying to CloudFoundry instances (such as GOV.UK PaaS) where the buildpack fails on the semver range:

   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): >=8.9.1 <9.0
          engines.npm (package.json): unspecified (use default)
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
          **ERROR** Unable to install node: improper constraint: >=8.9.1 <9.0
   Failed to compile droplet: Failed to run all supply scripts: exit status 14

Using ^8.9.1 instead which is semantically equivalent (any version greater than 8.9.1 but less than 9.0) allows the app to deploy successfully:

   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): ^8.9.1
          engines.npm (package.json): unspecified (use default)
   -----> Installing node 8.11.3
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-8.11.3-linux-x64-34b80d71.tgz]
  • Current semver resolution for node >=8.9.1 <9.0: 8.11.3
  • Current semver resolution for node ^8.9.1: 8.11.3

This fixes an issue when deploying to CloudFoundry instances (such as GOV.UK PaaS) where the buildpack fails on the semver range:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): >=8.9.1 <9.0
          engines.npm (package.json): unspecified (use default)
          **WARNING** Dangerous semver range (>) in engines.node. See: http://docs.cloudfoundry.org/buildpacks/node/node-tips.html
          **ERROR** Unable to install node: improper constraint: >=8.9.1 <9.0
   Failed to compile droplet: Failed to run all supply scripts: exit status 14
```

Using ^8.9.1 instead which is semantically equivalent (any version greater than 8.9.1 but less than 9.0) allows the app to deploy successfully:

```
   -----> Nodejs Buildpack version 1.6.28
   -----> Installing binaries
          engines.node (package.json): ^8.9.1
          engines.npm (package.json): unspecified (use default)
   -----> Installing node 8.11.3
          Download [https://buildpacks.cloudfoundry.org/dependencies/node/node-8.11.3-linux-x64-34b80d71.tgz]
```
Copy link

@kr8n3r kr8n3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ace. more happy customers 👍

@36degrees 36degrees merged commit 9fd13da into master Jul 24, 2018
@36degrees 36degrees deleted the update-node-dependency branch July 24, 2018 07:56
@joelanman joelanman mentioned this pull request Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants