Firebase not updating to Node 12 - node.js

Following the instructions here:
https://firebase.google.com/docs/functions/manage-functions#upgrade-node10
I have already changed my package.json engine to 12:
"engines": {
"node": "12"
},
and my Firebase CLI version is:
firebase -V
9.5.0
However even after deploying functions it says I am still on Node 10:
node -v
v10.16.0
Any idea what the problem is?

The node found in your command line doesn't have anything to do with the config for your firebase CLI in package.json. Changing package.json does not affect your node installation in any way. If you are working with Cloud Functions, the only thing that happens when you change "engines" is the target version of node used by the cloud service (not your machine) after you deploy your functions.
If you want to update the node version on your machine, you will have to do that independently of the Firebase CLI. You will need to follow whatever instructions are relevant for your machine to do that (apt? homebrew? nvm? we don't know) - Firebase will not be able to help.

Related

How to know what version of node I need to run a react app?

I have a react app, the npm install and npm start operations to run it on node v12.18.2 work perfectly but gives error on node v17.3.0. So how to know what versions of node can i use for the app to run successfully.
The React application has a package.json file and in this file, it is usually specified the version of node it needs to run successfully. This information can be found in the section called engines
{
"engines": {
"node": ">=0.10.3 <15"
}
}
The above code says that the application runs successfully if the version of node is higher than 0.10.3 but lower than 15.

Engine "node" not compatible with this module

I am having issues deploying recent changes made from a Gatsby project to Netlify. Start and build commands for the project locally works fine.
Here is the problem:
error gatsby#3.6.0: The engine "node" is incompatible with this module. Expected version ">=12.13.0". Got "10.24.1"
Here are links to the repo and deployment log:
https://github.com/simonxcode/simonxcode.com
https://app.netlify.com/sites/simonxcode/deploys/60aeec1c22d2e5154232e488
I know this question has been asked numerous times before, but none of the common solutions worked for me. Perhaps I am executing them incorrectly or may be missing something else.
Here are the solutions that I have tried:
execute yarn --ignore-engines from How to ignore incompatible engine "node" error on installing npm dependencies with yarn?
set node variable in .env file (not visible in repo because .gitignore) from Setting Environment Variables for Node to retrieve
//.env file
NODE_ENV=development
add "engine": { "node": ">=12.13.0"} to package.json from The engine "node" is incompatible with this module
Update node with brew update and brew upgrade node from The engine "node" is incompatible with this module
Note 1: Before updating Homebrew, I deleted node_modules/ and yarn.lock files
Note 2: after executing brew postinstall node and brew link --overwrite node, I no longer have access to node, yarn or gatsby when checking with node -v, yarn -v and gatsby -v
I was able to resolve this issue by declaring Node version in Netlify's deployment setting. Build and Deploy environment variables were:
key: NODE_VERSION value: 12.13.0
Screenshot of Environment Variable
Here is more information regarding how to manage dependecies on Netlify.
https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript
Lastly, I ran into some other issues with current version of node(16.2.0), so will stick with 12.13.0 for now. ;)
As of 21 November 2021, if Expected version ">=14.15.0". Got "12.13.0". Simply update your Netlify environment variables with:
Key: NODE_VERSION Value: 14.15.0
It works fine for me.
I've run into a similar issue using an outdated NodeJs version.
Check:
npm get
to see if you have strict engine checking set to true.
If so, and if you are not in a position to simply upgrade node:
npm set engine-strict false
This fixed my issue while working on an upgraded version of the project.
I took care of this by using nvm. Nvm is the node version manager. I simply ran nvm install 12.13.0 and everything then worked fine.

Firebase shell still reads my Node version 12 instead of the Nvm version

My problem is a bit tedious and need the community to help me out here.
I installed node 12 from the official site of Nodejs.org using it's .pkg file.
I use firebase functions shell to test our work locally, but due to version conflicts I need to downgrade to 10.
This is where the problems start, I installed NVM to get the downgraded version, and I was successful, so when I do node -v I see the v10 but when I run
firebase functions:shell
I still get the warning
Your requested "node" version "10" doesn't match your global version "12"
Now I need to get this sorted because my local cloud functions still don't work and I think it's still reading the 12th version of the node. I've followed different tutorials of manually deleting node from your system and again I was able to delete Node by verifying
node -v it gave me an error of node command not found which means Node was deleted, but even though Node uninstalled I still was able to run
firebase functions:shell and run the cloud function locally, so it means node 12 is still in the system but I can't seem to uninstall it.
So any help in this would be really appreciated.
Thanks
I was able to solve this using the following ways
Delete firebase from the global directory in the root folder.
So I wrote which firebase and it gave me a location on the root folder. I deleted that firebase instance.
Then I installed firebase using npm i -g firebase-tools this was installed directly into my nvm version of the node.
Only after that I was able to run firebase on the node version which I was using on the nvm
Open a new terminal and use nvm to set the version you need npm use 12. Finally, install the packages again with npm install.

Azure Deployment Angular .NetCore

I have a project .NetCore Angular and i try to publish it on azure using FTP.
Once the FTP is done publishing the files, and i access the website i am getting an error
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
Please take note on my local environment i am using node version 12.14.0
I am suspecting the error happens of my node version on my Azure Enviroment. My Question right now,is that how do i update
node version on my azure environment.
Thanks In advance.
Sincerely yours,
Pong
You can set the WEBSITE_NODE_DEFAULT_VERSION in the portal by checking the nodejs version from D://program files(x86)/nodejs.-
From all the available versions, choose one and update WEBSITE_NODE_DEFAULT_VERSION. Also keep in mind that Azure Functions runtime v1(~1) locks your node version at v6.11.
To use a configurable Node.js runtime, you'll, need to upgrade your Functions runtime to v2.x:
Go through this doc for more reference : NodeJS Version reference doc

How to upgrade Node.js in OpenShift Gear

I am trying to add a Meteor.Js project to an OpenShift Gear by following this tut:
https://www.openshift.com/blogs/cloudy-with-a-chance-of-meteorjs
I had to use mongoDB-2.4 other than that I followed the rest of the tut.
upon pushing my project to the Gear and getting a success status from the rhc cli, I went to the URL and got a 503. Then I restarted the app, with the same results. Then I used the command:
rhc tail <appName> #<appName> is the actual name of my app
And got the error code:
Meteor requires Node v0.10.26 or later.
DEBUG: Program node meteorshim.js exited with code 1
DEBUG: Starting child process with 'node meteorshim.js'
After that I destroyed the gear and tried again this time changing the created package.json created by the meteor-shim to node version to '0.10.29' (it had originally said 0.10.9), I run 0.10.29 on my machine.
I bundled and pushed this one, with the same results. So I ssh'ed into the Gear and typed 'node -v' and it outputted
v0.6.20
How do I at least get node version 0.10.26?
Note: The Cartridge in the Application web interface says node.js 0.10
The answer is you can't get v0.10.26 or later on OpenShift currently. At least not that I know of. v0.10.25 seems to be the latest version you can get on OpenShift at the moment.
Although it shows v0.6.20 doing "node -v" while you're on their system, it's actually running v0.10.25 if you created your app as node v0.10. When you push your code on there, check the output, one of those lines should be:
remote: npm info using node#v0.10.25
I've tried changing the version in package.json as below to see if it works but v0.10.25 is the latest version OpenShift is currently providing:
"engines": {
"node": ">= 0.10.26", <<<<< it's not taking this version
"npm": ">= 1.0.0"
},

Resources