admin管理员组文章数量:1405414
I'm using Google Cloud Shell, and the default node version is 12.14.1. Is there an easy way to update the node version to 14.x or 16.x?
node
seems to be installed with nvm
$ which node
/usr/local/nvm/versions/node/v12.14.1/bin/node
I'm using Google Cloud Shell, and the default node version is 12.14.1. Is there an easy way to update the node version to 14.x or 16.x?
node
seems to be installed with nvm
$ which node
/usr/local/nvm/versions/node/v12.14.1/bin/node
Share
Improve this question
edited Dec 30, 2021 at 16:19
Super Kai - Kazuya Ito
1
asked Jun 7, 2021 at 4:13
Tri NguyenTri Nguyen
11.2k9 gold badges48 silver badges78 bronze badges
3 Answers
Reset to default 8Apparently one can simply use nvm
mand to change the version. When I tried:
nvm install 14
I was upgraded to 14. I think I can install/change my node versions as desired.
nvm
isn't a file, but a bash function and is exposed via /google/devshell/bashrc.google.d/nvm
.
This script is sourced by default by /google/devshell/bashrc.google
. However, I inadvertently mented out these lines, which disabled it
if [ -f "/google/devshell/bashrc.google" ]; then
source /google/devshell/bashrc.google
fi
For anyone who's curious, those lines are put in there by /etc/profile.d/restore_bashrc.sh
.
If you ran into a similar issue and want to fix it manually, you can add the following lines to your .bashrc
for FILE in /google/devshell/bashrc.google.d/*; do
if [ -f "$FILE" ]; then
source "$FILE"
fi
done
Dec, 2021 Update:
This installs the latest LTS version:
nvm install 16.13.1
If you don't mind the specific version:
nvm install 16
In addition, this installs the latest Current version:
nvm install 17.3.0
If you don't mind the specific version:
nvm install 17
本文标签: javascriptHow to update node version on Google Cloud ShellStack Overflow
版权声明:本文标题:javascript - How to update node version on Google Cloud Shell - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744300939a2599577.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论