Right now, I'm using Heroku to deploy my app from GitHub. Here's deploy output log:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 16.x
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.3.0...
Using default npm version: 7.15.1
-----> Installing dependencies
Installing node modules (package.json)
added 149 packages, and audited 150 packages in 9s
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 150 packages in 866ms
10 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build succeeded!
-----> Discovering process types
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 48M
-----> Launching...
Released v3
https://dino-pack.herokuapp.com/ deployed to Heroku
However, when I go to dino-pack.herokuapp.com, it shows me this:
What is the problem, and how can I fix it? I've tried deleting and re-making the application, but it still shows this.
Check if your setup was done correctly, Procfile and the package.json. Follow a setup guide to double check. I'm sure it's a silly error but we need more info to find out what it is.
As near as I can tell from your logs there appears to be a path resolution issue. Some modules don't handle relative paths very well.
If you have an import somewhere that uses a relative path I would try changing that to either a relative format that works or first try an absolute path and see what shows up in the logs then.
This is just a guess since you don't want to share your code.
Related
Building node project results in
Error: Unknown error installing "18.x" of node
I have no idea why this is happening. It succeded to build the other day.
package.json and package-lock.json are on my github https://github.com/HoosierTransfer/unblocker
The build logs are
-----> Building on the Heroku-22 stack
-----> Using buildpack: heroku/nodejs
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 18.x...
Error: Unknown error installing "18.x" of node
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I tried to roll back the package.json and package-lock.json but that didnt fix anything.
Heroku recently changed their default Node version from 16 to 18:
https://devcenter.heroku.com/changelog-items/2487
If you used a different version in your project (for example 16), it could now break during build. Adding it to your package.json file should fix this:
"engines": {
"node": "16.x"
}
If your not sure which version you need, go to your project in your terminal, run node --version, and use the (major) version that's displayed there.
I am trying to deploy my reactjs app to heroku. The deployment is successful, but whenever I open up the application, it just displays Application Error.
I have already added https://github.com/mars/create-react-app-buildpack into the buildpack in heroku settings and created a procfile with web: bin/boot inside of it.
This is the build log:
-----> Building on the Heroku-20 stack
-----> Using buildpacks:
1. heroku/nodejs
2. https://github.com/mars/create-react-app-buildpack
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.15.0...
Using default npm version: 8.5.5
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Installing node modules
added 1927 packages, and audited 1928 packages in 40s
80 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build
Running build
> geoffhui.github.io#0.1.0 build
> react-scripts build
Creating an optimized production build...
Compiled with warnings.
./src/functions/data.js
Line 1: Multiline support is limited to browsers supporting ES5 only no-multi-str
./src/App.js
Line 20: Expected a default case default-case
Line 28: Expected a default case default-case
Line 78: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Line 85: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
./src/components/FolderDataContainer.js
Line 34: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
48.24 KB build/static/js/1.0df6a7a0.chunk.js
2.33 KB build/static/js/main.b4134d42.chunk.js
1.32 KB build/static/css/main.618b06ac.chunk.css
763 B build/static/js/runtime~main.229c360f.js
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 1912 packages in 4s
77 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build succeeded!
-----> React.js (create-react-app) multi app detected
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-multi.git
=====> Detected Framework: Multipack
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-nodejs.git
=====> Detected Framework: Node.js
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_HOME=/tmp/build_cefa3715/.heroku/node
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 16.x...
Downloading and installing node 16.15.0...
Using default npm version: 8.5.5
-----> Restoring cache
Cached directories were not restored due to a change in version of node, npm, yarn or stack
Module installation may take longer for this build
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
rebuilt dependencies successfully
Installing any new modules (package.json)
added 16 packages, and audited 1928 packages in 7s
80 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build
Running build
> geoffhui.github.io#0.1.0 build
> react-scripts build
Creating an optimized production build...
Compiled with warnings.
./src/functions/data.js
Line 1: Multiline support is limited to browsers supporting ES5 only no-multi-str
./src/App.js
Line 20: Expected a default case default-case
Line 28: Expected a default case default-case
Line 78: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Line 85: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
./src/components/FolderDataContainer.js
Line 34: Using target="_blank" without rel="noopener noreferrer" is a security risk: see https://mathiasbynens.github.io/rel-noopener react/jsx-no-target-blank
Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.
File sizes after gzip:
48.24 KB build/static/js/1.0df6a7a0.chunk.js
2.33 KB build/static/js/main.b4134d42.chunk.js
1.32 KB build/static/css/main.618b06ac.chunk.css
763 B build/static/js/runtime~main.229c360f.js
The project was built assuming it is hosted at the server root.
You can control this with the homepage field in your package.json.
For example, add this to build it for GitHub Pages:
"homepage" : "http://myname.github.io/myapp",
The build folder is ready to be deployed.
You may serve it with a static server:
npm install -g serve
serve -s build
Find out more about deployment here:
-----> Caching build
- node_modules
-----> Pruning devDependencies
up to date, audited 1912 packages in 4s
77 packages are looking for funding
run `npm fund` for details
68 vulnerabilities (14 low, 17 moderate, 32 high, 5 critical)
To address issues that do not require attention, run:
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
-----> Build succeeded!
=====> Downloading Buildpack: https://github.com/mars/create-react-app-inner-buildpack.git#v9.0.0
=====> Detected Framework: React.js (create-react-app)
Writing `static.json` to support create-react-app
Enabling runtime environment variables
=====> Downloading Buildpack: https://github.com/heroku/heroku-buildpack-static.git
=====> Detected Framework: Static HTML
-----> Installed nginx 1.21.3 to /app/bin
Using release configuration from last framework (Static HTML).
-----> Discovering process types
~ Mis-cased procfile detected; ignoring.
~ Rename it to Procfile to have it honored.
Procfile declares types -> (none)
Default types for buildpack -> web
-----> Compressing...
Done: 113.5M
-----> Launching...
Released v13
https://geoff-portfolio.herokuapp.com/ deployed to Heroku
Any ideas?
I've seen you are using two build packs
-----> Using buildpacks:
1. heroku/nodejs
2. https://github.com/mars/create-react-app-buildpack
Could you try to remove heroku/nodejs and keep only create-react-app-buildpack?
Steps : App -> Settings -> buildpacks
settings
First of all, hello everyone. I created a bot for Telegram that I wrote with node.js. When I want to deploy it on Heroku, it continues to deploy for a very long time (Approximately 20mins and failure). When I want to try the bot on telegram it works fine. But I still see "Pending" text instead of "Success" in the Github Environments section. What can I do? The logs are like this:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): 16.14
engines.npm (package.json): 8.5
Resolving node version 16.14...
Downloading and installing node 16.14.2...
Bootstrapping npm 8.5 (replacing 8.5.0)...
npm 8.5 installed
-----> Installing dependencies
Installing node modules
added 126 packages, and audited 127 packages in 2s
16 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
-----> Build
Running build
> pokedex-bot-telegram#1.0.0 build
> node index.js
-----> Timed out running buildpack Node.js
Terminated
! Push failed
Below is the JSON extracted from the comments from your question. This helps with solving the issue.
{
"scripts": {
"start": "node index.js",
"build": "node index.js",
"dev": "nodemon index.js"
}
}
The solution is to delete the build step.
This is because start and build are doing the exact same things, so there's no point in running it twice.
When you remove the build part, and run it again, it should complete everything, without getting stuck on build.
I am trying to create a brand new strapi v4 project and that works fine locally but when I try and deploy it to Render or Heroku (which I’ve done before many times on Strapi v3) I get a build error when it tries to grab fontawesome-free-5.15.4.tgz from fontawesome. The error log I get on both Render and Heroku is:
error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_2d005b2a/yarn-error.log".
Is there something I can do to solve the issue? If I go to https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz myself, it asks for a username and password so I’m assuming that when Render/Heroku try and hit that URL they don’t have a username and password to send. (And the same goes for all the different npm.fontawesome.com links in the yarn.lock file).
If this is the case, why does the project build and run fine locally? Shouldn’t I also have to input those credentials? Do they need to be added as environment variables on Render/Heroku somehow?
Sorry, I’m quite new to all this! I was following this tutorial on the Strapi blog: https://strapi.io/blog/deploying-a-strapi-api-on-heroku
Any help is greatly appreciated.
Thanks!
P.S. Here is the full error log from Heroku:
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
USE_YARN_CACHE=true
NODE_VERBOSE=false
NODE_ENV=production
NODE_MODULES_CACHE=true
-----> Installing binaries
engines.node (package.json): >=12.x.x <=16.x.x
engines.npm (package.json): >=6.0.0
engines.yarn (package.json): unspecified (use default)
Resolving node version >=12.x.x <=16.x.x...
Downloading and installing node 16.14.1...
Bootstrapping npm >=6.0.0 (replacing 8.5.0)...
npm >=6.0.0 installed
Resolving yarn version 1.22.x...
Downloading and installing yarn (1.22.17)
Installed yarn 1.22.17
-----> Installing dependencies
Installing node modules (yarn.lock)
yarn install v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
error An unexpected error occurred: "https://npm.fontawesome.com/#fortawesome/fontawesome-free/-/5.15.4/fontawesome-free-5.15.4.tgz: Request failed \"401 Unauthorized\"".
info If you think this is a bug, please open a bug report with the information provided in "/tmp/build_2d005b2a/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Dangerous semver range (>) in engines.node
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
I have a freshly new Angular project that I've pushed on my self hosted Gitlab instance.
I have enable AutoDevOps and run a pipeline but the build stage is stuck on the step 5/11 (buildpack) during the build process.
Step 5/11 : RUN /bin/herokuish buildpack build
---> Running in 16d521d8adbf
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.13.1...
Using default npm version: 6.12.1
-----> Installing dependencies
Installing node modules (package.json + package-lock)
After ~15min the job end with a job succeeded message but it didn't pass the 5th step (and so the create dpod is missing the docker image).
I wanted to update the gitlab-ci yml file of the AutoDevOps but the build script is using registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image/master:stable so I'm not able to update the script.
Any idea why the build is being stuck on installing dependencies ? If it's a kind of timeout is their any parameters I can tweak ?