[英]I can't upgrade nodejs version from 10.24.0 to 14.16.1(LTS) on Raspberry Pi Desktop
I installed Raspberry Pi Desktop on an old laptop and then I installed nodejs using 'sudo apt install nodejs'.我在一台旧笔记本电脑上安装了 Raspberry Pi Desktop,然后使用“sudo apt install nodejs”安装了 nodejs。 After that, when I verify the version of node, using 'node -v' or 'nodejs -v' I get 'v10.24.0'.
之后,当我验证节点的版本时,使用“node -v”或“nodejs -v”我得到“v10.24.0”。 Then I try upgrade the Nodejs version but it doesn't work because whatever way I used to upgrade, the version stays the same.
然后我尝试升级 Nodejs 版本,但它不起作用,因为无论我用什么方式升级,版本都保持不变。
I try this:我试试这个:
pi@local-server-raspi:~ $ sudo su -
root@local-server-raspi:~ # apt-get remove nodered -y
root@local-server-raspi:~ # apt-get remove nodejs nodejs-legacy -y
root@local-server-raspi:~ # apt-get remove npm -y
root@local-server-raspi:~ # curl -sL https://deb.nodesource.com/setup_14.x | sudo bash -
root@local-server-raspi:~ # apt-get install nodejs -y
root@local-server-raspi:~ # node -v
v10.24.0
root@local-server-raspi:~ # npm -v
bash: npm: command not found
I also try with nvm but with the same result, when I type 'nodejs -v' I get 'no such file or directory' and when I type 'node -v' I get the same version, 10.24.0.我也尝试使用 nvm,但结果相同,当我输入“nodejs -v”时,我得到“没有这样的文件或目录”,当我输入“node -v”时,我得到相同的版本,10.24.0。
I appreciate it if any of you have some idea how to upgrade the version of the nodejs to the LTS version, 14.16.1.如果你们中有人知道如何将 nodejs 的版本升级到 LTS 版本 14.16.1,我将不胜感激。
I had the same problem while trying to install nodejs to the raspberrypi 4. I needed a newer version to run yarn.我在尝试将 nodejs 安装到 raspberrypi 4 时遇到了同样的问题。我需要一个更新的版本来运行 yarn。 There are many tutorials but this instruction video (below) fixed my problem and upgraded the nodejs to 14.16.1.
有很多教程,但是这个说明视频(下面)解决了我的问题并将 nodejs 升级到 14.16.1。 (Thanks Dave.!!) thisdavej.com/upgrading-to-more-recent-versions-of-node-js-on-the-raspberry-pi/
(感谢戴夫。!!)thisdavej.com/upgrading-to-more-recent-versions-of-node-js-on-the-raspberry-pi/
I had the same problem on Raspberry Pi3.我在 Raspberry Pi3 上遇到了同样的问题。 I tried all sorts of things and this is what finally worked...
我尝试了各种各样的东西,这就是最终奏效的方法......
node -v
v10.24.0
# Remove...
sudo apt remove node
sudo apt remove nodejs
# Install...
sudo curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# Check
node -v && npm -v
v14.19.3
6.14.17
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.