I have a Node project that I want to host on Heroku. I have explicitly defined node and npm versions in my package.json (located in the root directory), which looks like this:
{
"name": "*********",
"version": "1.0.0",
"description": "**********",
"engines": {
"node": "8.x",
"npm": "6.x"
},
"private": true,
.....
}
However, when I try to push the app to heroku. It still not read the node and npm version.
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use
default)
remote: Resolving node version 10.x...
remote: Downloading and installing node 10.15.3...
remote: Using default npm version: 6.4.1
Is there any solution for my case? Thank you anyway
I resolved this by adding engines in package.json file
"name": "myApp",
"version": "1.0.0",
"engines": {
"node": "14.17.0",
"npm": "6.14.13"
},
"main": "index.ts",
reference link :-https://help.heroku.com/6235QYN4/why-is-my-node-js-build-failing-because-of-no-matching-node-versions
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With