Update Node version for Meteor app deployed to Heroku - node.js

I have a Meteor application deployed to Heroku. To prevent the Denial of Service (DoS) vulnerability, Heroku suggested updating the Node.js version
for my application. I want to update the meteor version to 1.2.1 and node version to 4.8.4 on Heroku. I have set the node version in packages.json as well but it was not updated after deployment.
How can I update meteor and node on Heroku? I tried the following command:
heroku run meteor update --release 1.2.1 -a myappname
but it throws the following error:
bash: meteor: command not found
Any help would be much appreciated.
Thanks in advance!

To update my application's node version to 4.8.4, I updated Meteor version to 1.5.1 on my local machine, fixed the dependencies issues and pushed code to the Heroku application which solved the issue.
I used the following command to update Meteor version to 1.5.1 which updated the node package version to 4.8.4 as well:
meteor update --release 1.5.1
After committing and pushing code to Heroku, there were a few babel-runtime and bcrypt crashes. I executed the following commands to fix those issues:
meteor npm install --save babel-runtime
meteor npm install --save bcrypt
meteor update iron:middleware-stack.
Pushing these updates to Heroku solved my issue.

You can use the following command to update Meteor version to 1.5.1
meteor update --release 1.5.1

Command like heroku run meteor update will not work because Meteor is not installed (and is not meant to be) in the Heroku environment.
It is used in the buildpack (assuming you use the Meteor buidpack horse) to build your Meteor project source code into production version. It then becomes a "standard" node app. The buildpack also reads the node version required by the project Meteor version (not the one specified in your package.json file unfortunately) and configures your Heroku environment accordingly.
The buildpack does everything automatically from your Meteor project source code, but that also means that it is tied to Meteor (which is also understandable because any arbitrary node version may not work with Meteor).

Related

NG command is displaying incorrect node version

I am getting below error when I tried to use ng command
Node.js version v11.13.0 detected.
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.
Please update your Node.js version or visit https://nodejs.org/ for additional instructions.
When I try to see the node version using node -v, I see node version on my machine is v12.18.3
So from where ng is getting v11.13.0? How do I resolve this issue?
I tried below steps
Clear the NPM cache
Uninstall both node versions from the NVM
Uninstall anything that starts with node in Control Panel\Programs and Features
Install required node versions in NVM
Install Angular CLI
and things started working for me.
Had the same issue. It turns out installed Angular CLI was not compatible with the installed node and npm version. I used the https://stackoverflow.com/a/60258560 to check the compatibility. Then performed following steps:
Uninstall Angular cli
Uninstall Node and NVM
Installed Node version I wanted (10.x).
Installed specific Angular version corresponding to Node v10 which was Angular Cli v11 at this time.
I was also facing the same issue in my Windows machine where the node -v version and the version picked up by ng command were different. This was because my node.js command prompt was picking the version from AppData\Roaming\npm folder. Cleaning up this folder fixed the issue for me.
Uninstall node
Empty the contents from C:\Users<user>\AppData\Roaming\npm
Install the required node version

what's the comand to know the Node.js version in angular's eyes(opinion)?

when I do mvn compiling for flink source code,I get:
Node.js version v9.0.3 detected.
The Angular CLI requires a minimum Node.js version of eithor v10.13 or v12.0
when I input node -v, the result is 12.18
so,what's the comand to know the Node.js version in angular's eyes?
and where does the old version v9.0.3 come from?
I restart my computer and the error remains.
Thanks for your help.
(Python3.6) appleyuchi#Desktop:~$ which npm
/home/appleyuchi/.nvm/versions/node/v12.18.0/bin/npm
(Python3.6) appleyuchi#Desktop:~$ which nodejs
(Python3.6) appleyuchi#Desktop:~$ which node
/home/appleyuchi/.nvm/versions/node/v12.18.0/bin/node
I compile and get the following message again
Node.js version v10.9.0 detected.
what do you mean by angular's eyes? There is no different node for angular. if it is installed then the node is same for all framework.
Follow this link to check Angular, Node.js and TypeScript compatibility.
https://gist.github.com/LayZeeDK/c822cc812f75bb07b7c55d07ba2719b3
You can use nvm if you want to work with multiple node versions
this link will help in using nvm
https://www.sitepoint.com/quick-tip-multiple-versions-node-nvm/

Node-sass doesn't have binding with node version which uses in TestCafe Docker Image

Initially, i faced the issue, that concurrency doesn't work in Jenkins. I find this issue in official repository and followed advise to update Testcafe Docker Image to latest version (i took it from testcafe/testcafe repository). However, now i faced another issue. We have node-sass package using for web app which i test, and node-sass doesn't work with Node 10.x and displays this error message
Module build failed: Error: Missing binding /tests/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 10.x
Found bindings for the following environments:
- Linux/musl 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
Is there is some workaround for it, or maybe Testcafe can use Node 8.x and then you can provide Docker Image with this node version?
At the moment we do not have plans to create multiple testcafe docker images for different node versions. However, I created a separate feature request.
Please track that ticket and vote for it. We can add it to our plans in the future.

NodeJS server and React app can't use the same version of Node

Here is my problem and it might be super simple to fix, but I am new to the world of web technologies.
I have a react app that is running using node version 10.0.0. I am using npm n as my node version manager, and I am using n stable as my version selector.
When I try to run the NodeJS server that is supposed to accompany it, it fails when I try to run it with node version 10. I have to go back to version 4.9.1, so I can run the server without any problems.
Has anyone else faced this issue or know what it could be? If I go to a newer version of node I get a Bindings.js npm error. If I build my react app with 4.9.1, well that doesn't work at all.
To run both at the same time I have to switch to node version 4.9.1 and then run the nodeJS server, then change to version 10 and build the react app which to me is not how a production build should go.
Any thoughts?

Issue with deployment of Meteor 0.7.0 app to Heroku - Node.js 0.10.22 is required

Meteor 0.7.0 now uses 0.10.22 version of Node.js but Heroku installs 0.10.21 by default.
Is there any way to specify custom version of Node.js for Heroku because as far as I know we can't create package.json file in Meteor apps.
Won't meteor just ignore the package.json? Try creating one that only specified Node version.

Resources