Skip to content

Commit c5c1fe6

Browse files
authored
Add package.json for heroku/nodejs compat (heroku#75)
Without this change file if you try to use `heroku/nodejs` and Ruby you get this: ``` $ git push heroku schneems/packagejson:main Enumerating objects: 413, done. Counting objects: 100% (413/413), done. Delta compression using up to 8 threads Compressing objects: 100% (226/226), done. Writing objects: 100% (413/413), 83.76 KiB | 41.88 MiB/s, done. Total 413 (delta 160), reused 413 (delta 160), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Using buildpacks: remote: 1. heroku/nodejs remote: 2. heroku/ruby remote: -----> App not compatible with buildpack: https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku/nodejs.tgz remote: remote: ! ERROR: Application not supported by 'heroku/nodejs' buildpack remote: ! remote: ! The 'heroku/nodejs' buildpack is set on this application, but was remote: ! unable to detect a Node.js codebase. remote: ! remote: ! A Node.js app on Heroku requires a 'package.json' at the root of remote: ! the directory structure. remote: ! remote: ! If you are trying to deploy a Node.js application, ensure that this remote: ! file is present at the top level directory. This directory has the remote: ! following files: remote: ! remote: ! app/ remote: ! app.json remote: ! bin/ remote: ! config/ remote: ! config.ru remote: ! db/ remote: ! Gemfile remote: ! Gemfile.lock remote: ! lib/ remote: ! log/ remote: ! Procfile remote: ! public/ remote: ! Rakefile remote: ! README.md remote: ! test/ remote: ! vendor/ remote: ! remote: ! If you are trying to deploy an application written in another remote: ! language, you need to change the list of buildpacks set on your remote: ! Heroku app using the 'heroku buildpacks' command. remote: ! remote: ! For more information, refer to the following documentation: remote: ! https://devcenter.heroku.com/articles/buildpacks remote: ! https://devcenter.heroku.com/articles/nodejs-support#activation remote: remote: remote: More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to evening-wildwood-31328. remote: To https://git.heroku.com/evening-wildwood-31328.git ! [remote rejected] schneems/packagejson -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/evening-wildwood-31328.git' ``` With this change: ``` $ git push heroku schneems/packagejson:main Enumerating objects: 416, done. Counting objects: 100% (416/416), done. Delta compression using up to 8 threads Compressing objects: 100% (228/228), done. Writing objects: 100% (416/416), 83.66 KiB | 41.83 MiB/s, done. Total 416 (delta 162), reused 411 (delta 160), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Building on the Heroku-20 stack remote: -----> Using buildpacks: remote: 1. heroku/nodejs remote: 2. heroku/ruby remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: NODE_VERBOSE=false remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: remote: -----> Installing binaries remote: engines.node (package.json): unspecified remote: engines.npm (package.json): unspecified (use default) remote: remote: Resolving node version 14.x... remote: Downloading and installing node 14.16.0... remote: Using default npm version: 6.14.11 remote: remote: -----> Installing dependencies remote: Installing node modules (package.json) remote: up to date in 0.251s remote: found 0 vulnerabilities remote: remote: remote: -----> Build remote: remote: -----> Caching build remote: - node_modules (nothing to cache) remote: remote: -----> Pruning devDependencies remote: up to date in 0.247s remote: found 0 vulnerabilities remote: remote: remote: -----> Build succeeded! remote: -----> Ruby app detected remote: -----> Installing bundler 1.17.3 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.6 remote: -----> Installing dependencies using bundler 1.17.3 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4 remote: Fetching gem metadata from https://rubygems.org/............ remote: Fetching rake 12.3.3 remote: Installing rake 12.3.3 remote: Fetching concurrent-ruby 1.1.5 remote: Fetching minitest 5.11.3 remote: Fetching thread_safe 0.3.6 remote: Installing minitest 5.11.3 remote: Installing concurrent-ruby 1.1.5 remote: Installing thread_safe 0.3.6 remote: Fetching builder 3.2.3 remote: Installing builder 3.2.3 remote: Fetching erubi 1.8.0 # ... ```
1 parent 64b4d97 commit c5c1fe6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

0 commit comments

Comments
 (0)