首页 > 解决方案 > Can not Install NPM along side with the ROS melodic?

问题描述

I am using ROS melodic for my current project but I need to install nodejs for my college work in ubuntu 18.04. When I install nodejs by using the following commands

sudo apt install nodejs
sudo apt install npm

it gives me an error like this. error

So I installed that dependency but after installing that dependency my ros packages removed.
How can I install the npm without losing the ROS melodic?

Thanks in advance !!

标签: node.jsros

解决方案


我在互联网上找到了一些可以让我找到解决方案的东西,我安装了 python 虚拟环境

https://linuxize.com/post/how-to-create-python-virtual-environments-on-ubuntu-18-04/

在那个虚拟环境中,我在 pip 的帮助下安装了 nodeenv

https://pypi.org/project/nodeenv/#id73

我创建了 node.js 虚拟环境,在其中安装了 NPM,没有出现任何错误。 在此处输入图像描述

我们也可以在全局环境中安装 nodeenv!


推荐阅读