dwyl / labels

🏷 Sync GitHub Labels from any Source to Target Repositories for Consistency across all your projects!
https://labels.fly.dev/
138 stars 11 forks source link

Heroku Build Failed: Node version not specified in package.json #95

Closed nelsonic closed 4 years ago

nelsonic commented 4 years ago

image

https://dashboard.heroku.com/apps/label-sync/activity/builds/af659b46-553d-4a27-a51d-0292aa216dec image

https://devcenter.heroku.com/articles/troubleshooting-node-deploys https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version

Appears we've got to specify a Node.js version in package.json

nelsonic commented 4 years ago

Visiting the settings page for the app: https://dashboard.heroku.com/apps/label-sync/settings image

We see that the specified Buildpack is:

https://github.com/heroku/heroku-buildpack-nodejs#v83

Released 5 Oct 2015: https://github.com/heroku/heroku-buildpack-nodejs/releases/tag/v83 image

We will need to upgrade this to the latest version of Node.js as part of #94 But for now I'm just trying to figure out what version of Node is being used (working) so that I can specify it in the package.json so we can deploy the label.description PR #93

nelsonic commented 4 years ago

Sadly the Heroku Buildpack release doesn't give us any info regarding the Node.js version. image

The CHANGELOG.md doesn't give us any insight into what Node.js they were using: 🤦 image

Thankfully we can lookup what Node.js version was current back in October 2015: https://nodejs.org/en/download/releases nodejs-version-october-2015

So I'm going to try specifying Node.js 4.1.1 released 2015-09-23.

nelsonic commented 4 years ago

adding the engines directive to package.json with Node.js 4.1.1:

https://github.com/dwyl/labels/blob/cedc14f5eaee893642142f45dcdb4237983cb68f/package.json#L45-L47

appears to have worked when I pushed the branch to Heroku:

git push heroku add-node-version-to-packagejson-issue-95:master
Total 332 (delta 177), reused 316 (delta 169)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NPM_CONFIG_PRODUCTION=true
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  4.1.1
remote:        engines.npm (package.json):   unspecified (use default)
remote:
remote:        Downloading and installing node 4.1.1...
remote:        Using default npm version: 2.14.4
remote:
remote: -----> Restoring cache
remote:        Skipping cache restore (new runtime signature)
remote:
remote: -----> Building dependencies
remote:        Pruning any extraneous modules
remote:        Installing node modules (package.json)
remote:        hoek@4.2.1 node_modules/hoek
remote:
remote:        env2@2.2.2 node_modules/env2
remote:
remote:        hapi-auth-github@2.1.2 node_modules/hapi-auth-github
remote:
remote:        vision@4.1.1 node_modules/vision
remote:        ├── boom@4.3.1
remote:        ├── items@2.1.2
remote:        └── joi@10.6.0 (topo@2.0.2, isemail@2.2.1)
remote:
remote:        handlebars@4.7.6 node_modules/handlebars
remote:        ├── wordwrap@1.0.0
remote:        ├── minimist@1.2.5
remote:        ├── source-map@0.6.1
remote:        ├── uglify-js@3.10.0
remote:        └── neo-async@2.6.2
remote:
remote:        hapi@15.2.0 node_modules/hapi
remote:        ├── topo@2.0.2
remote:        ├── catbox-memory@2.0.3
remote:        ├── boom@4.0.0
remote:        ├── items@2.1.1
remote:        ├── podium@1.2.3
remote:        ├── hoek@4.0.2
remote:        ├── shot@3.3.2
remote:        ├── statehood@5.0.0 (boom@3.2.2)
remote:        ├── heavy@4.0.2 (boom@3.2.2)
remote:        ├── iron@4.0.3 (boom@3.2.2)
remote:        ├── call@3.0.3 (boom@3.2.2)
remote:        ├── cryptiles@3.0.2 (boom@3.2.2)
remote:        ├── catbox@7.1.2 (boom@3.2.2)
remote:        ├── accept@2.1.2 (boom@3.2.2)
remote:        ├── ammo@2.0.2 (boom@3.2.2)
remote:        ├── mimos@3.0.3 (mime-db@1.23.0)
remote:        ├── subtext@4.3.0 (wreck@10.0.0, content@3.0.2, pez@2.1.2)
remote:        └── joi@9.0.4 (isemail@2.2.1, moment@2.14.1)
remote:
remote:        jsonwebtoken@7.4.3 node_modules/jsonwebtoken
remote:        ├── lodash.once@4.1.1
remote:        ├── ms@2.1.2
remote:        ├── xtend@4.0.2
remote:        ├── jws@3.2.2 (safe-buffer@5.2.1, jwa@1.4.1)
remote:        └── joi@6.10.1 (topo@1.1.0, isemail@1.2.0, hoek@2.16.3, moment@2.27.0)
remote:
remote: -----> Caching build
remote:        Clearing previous node cache
remote:        Saving 2 cacheDirectories (default):
remote:        - node_modules
remote:        - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote:        ├── env2@2.2.2
remote:        ├── handlebars@4.7.6
remote:        ├── hapi@15.2.0
remote:        ├── hapi-auth-github@2.1.2
remote:        ├── hoek@4.2.1
remote:        ├── jsonwebtoken@7.4.3
remote:        └── vision@4.1.1
remote:
remote: -----> Discovering process types
remote:        Procfile declares types     -> (none)
remote:        Default types for buildpack -> web
remote:
remote: -----> Compressing...
remote:        Done: 14.2M
remote: -----> Launching...
remote:        Released v18
remote:        https://label-sync.herokuapp.com/ deployed to Heroku

New version of app that copies label.description deployed. 🚀 Now using: https://label-sync.herokuapp.com image

We can update the labels on a random throwaway project, e.g: https://github.com/nelsonic/rumbl/labels

BEFORE: image

*AFTER: image

nelsonic commented 4 years ago

Works as expected. ✅