简体   繁体   English

在 Ubuntu 20.04 (WSL) 中安装节点 16 会给我节点 14

[英]Installing node 16 in Ubuntu 20.04 (WSL) gives me node 14

I installed node 16, on Ubuntu 20.04 (WSL on Windows10) using these commands:我使用以下命令在 Ubuntu 20.04(Windows10 上的 WSL)上安装了节点 16:

curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs

And it gets the right package它得到了正确的 package

Unpacking nodejs (16.13.1-deb-1nodesource1)...解压 nodejs (16.13.1-deb-1nodesource1)...
Setting up nodejs (16.13.1-deb-1nodesource1)...设置 nodejs (16.13.1-deb-1nodesource1)...

But somehow, I get node 14但不知何故,我得到了节点 14

$ node -v $节点-v
v14.15.5 v14.15.5

I had nodejs installed already before I tried to upgrade to 16 but I am pretty sure the installer removed it.在尝试升级到 16 之前,我已经安装了 nodejs,但我很确定安装程序已将其删除。

I tried to remove the package nodejs and installagain, I ran apt autoremove , I checked /etc/apt/sources.list.d/nodesource.list and there is only the node_16.x PPA...我试图删除 package nodejs并再次安装,我运行了apt autoremove ,我检查了/etc/apt/sources.list.d/nodesource.list并且只有node_16.x PPA ...

What did I miss?我错过了什么? Where is that node 14 coming from?那个节点 14 来自哪里?

My bad... Turns out it was emscripten who had installed another NodeJS in its own app folder and was setting that in the env.我的错...原来是emscripten在它自己的应用程序文件夹中安装了另一个NodeJS并将其设置在环境中。

I just deleted the node directory in the emsdk folder and it's working.我刚刚删除了emsdk文件夹中的node目录,它正在工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM