0

I am trying to deploy my app in Heroku server to be available in my customized domain name. Everything builds locally, but When I try to deploy in Heroku, the following error pops up. Please help.

This is my build log:

        -----> 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.16.3...
   Using default npm version: 6.14.4

    -----> 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
   npm ERR! code EINVALIDTAGNAME
   npm ERR! Invalid tag name "[object Object]": Tags may not have any characters that encodeURIComponent encodes.

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /tmp/npmcache.vvKxN/_logs/2020-05-23T20_24_41_347Z-debug.log
   -----> 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

1
  • 1
    Could you post the full log as indicated in the error message? Commented May 23, 2020 at 20:38

2 Answers 2

1

As the error says, you have not mentioned npm and node version in the package.json file.

"engines": {
    "npm": "x",
    "node": "y"
}

replace x and y with your version of npm and node. node -v and npm -v would provide you with your versions.

Sign up to request clarification or add additional context in comments.

Comments

1

You have possible problem 'Node version not specified in package.json'. You need to describe what version of node and npm or yarn you have using.

Why is my Node.js build failing because of an invalid semver requirement? might help.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.