node.js - 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 !!
解决方案
我在互联网上找到了一些可以让我找到解决方案的东西,我安装了 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!
推荐阅读
- android - 如何在 Android 中使用自定义文件名保存相机拍摄的图像?
- php - 如何将八进制转义 \303\241 解码为原始 utf-8 字符?
- android - 在 AndroidPdfViewer 上设置 RTL 滚动
- qt - 如何在图像中进行不透明度渐变?
- android-source - 使用系统属性更改 AOSP 覆盖
- vb.net - VB.Net 和 SQLite 不保存
- c# - 排队异步操作,让它们在 MVVM 应用程序中一次运行一个
- excel - 如何打开文件类型文件
- mysql - 如何多次加入同一个表以选择不同的列?
- java - 跳过非必需项的 Spring Boot Gradle 快速构建