'Changing node version (heroku, cloud9, RoR)

How do I change Heroku's node version to keep it from overriding the Cloud9 node version?

I'm following learnenough.com's Rails Tutorial. A noMethodError while installing webpacker lead me to check the node version.

ubuntu:~/environment/toy_app (master) $ node -v
v14.19.0
ubuntu:~/environment/toy_app (master) $ nvm use 16.13.0
Now using node v16.13.0 (npm v8.1.0)
ubuntu:~/environment/toy_app (master) $ node -v
v14.19.0
ubuntu:~/environment/toy_app (master) $ which node
/usr/local/heroku/bin/node

Also tried adding "engines": { "node": "16.x" } to package.json as well as changing the default (nvm alias default v16.13.0) to no avail.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source