Skip to content

Commit

Permalink
Specify node dependency using caret notation
Browse files Browse the repository at this point in the history
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]
```
  • Loading branch information
36degrees committed Jul 23, 2018
1 parent 7be8557 commit c887dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "7.0.0-beta.10",
"private": true,
"engines": {
"node": ">=8.9.1 <9.0"
"node": "^8.9.1"
},
"scripts": {
"start": "node start.js",
Expand Down

0 comments on commit c887dab

Please sign in to comment.