cianekaj's avatar

change the active node js version

Hello team, I am having an issue in my Laravel workspace that requires to change the active node js version to the installed one. This is due to the fact that I get error while running dev "npm run dev" and all the research I have done advise me to upgrade to the higher version. I have done the below in my project folder:

  • npm install npm@latest
  • npm install - g npm
  • npm install
  • echo "console.log('Node version: ' + process.version)" > index.js, then n use 14.15.0 index.js

but still the active version of node remains the oldest as shown to the below output from n stable command installed : v14.15.0 to /usr/local/bin/node active : v13.5.0 at /home/laradock/.nvm/versions/node/v13.5.0/bin/node

Can you please advice how to upgrade this. Thank you

0 likes
1 reply
steinbring's avatar

I've been struggling with this a lot over the past two weeks. If you update /laradock/.etc where it says ...

WORKSPACE_INSTALL_NODE=true WORKSPACE_NODE_VERSION=node

... supposedly, you can change the version of node. I am trying to get it to work with 14 and I have tried "14", "14.21.3", "node:14", and "node14" and none of them seem to work.

If you go into /laradock/workspace/Dockerfile, there is also ...

ARG NODE_VERSION=node ENV NODE_VERSION ${NODE_VERSION}

... and code that downloads and runs https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh using it to switch active node versions using NVM. Fiddling around with that doesn't seem to do anything, though.

Does anyone have a suggestion?

Please or to participate in this conversation.