简体   繁体   English

我无法在 Raspberry Pi Desktop 上将 nodejs 版本从 10.24.0 升级到 14.16.1(LTS)

[英]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.

相关问题 Raspberry Pi接近检测Node.js - Raspberry pi proximity detection nodejs 无法通过WebSocket连接Raspberry Pi服务器 - Can't connect Raspberry Pi server through WebSocket [Python][Heroku]不能经常向树莓派稳定发送信号 - [Python][Heroku]Can't send signal often to Raspberry Pi stably 我可以使用 chrome web 蓝牙低能量 android 将来自树莓派的图像的 stream 发送到 android 吗? - Can I send a stream of images from a raspberry pi to android using chrome web bluetooth low energy API? 无法升级到节点版本0.10.35之后 - Can't upgrade beyond node version 0.10.35 我可以将 python 用于基于 Raspberry Pi 的应用程序吗? - Can I use python for a Raspberry Pi based App? 我已经安装了Node 10时,如何安装LJS版本的NodeJS? - How do install the LTS version of NodeJS when I already have Node 10 installed? 为什么我的 Discord 机器人(NodeJS)在使用 pm2 在 Raspberry Pi 4 上重新启动系统后 go 不在线? - How come my Discord bot (NodeJS) doesn't go online after a system reboot on a Raspberry Pi 4, with pm2? 在树莓派3上通过智能手机打开页面 - Open a page from a smartphone on a raspberry pi 3 在Raspberry Pi上通过Web控制交流程序 - Control a c program from the web on a Raspberry Pi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM