Command ‘npm‘ not found, but can be installed with:sudo apt install npm 解决方案

问题描述

今天在执行

bash 复制代码
npm install -g npx

报错

Command 'npm' not found, but can be installed with:

sudo apt install npm

解决方案

bash 复制代码
sudo apt-get remove npm
sudo apt-get remove nodejs-legacy
sudo apt-get remove nodejs
sudo rm /usr/bin/node
sudo apt-get install nodejs
sudo apt-get install nodejs-legacy
sudo apt-get install npm.

参考链接

npm: command not found解决方案(已解决) - 知乎

相关推荐
老师用之于民19 小时前
【DAY21】Linux软件编程基础&Shell 命令、脚本及系统管理实操
linux·运维·chrome·经验分享·笔记·ubuntu
qinyia1 天前
通过本地构建解决Cartographer编译中absl依赖缺失问题
linux·运维·服务器·mysql·ubuntu
郝亚军1 天前
ubuntu启一个udp server,由一个client访问
linux·ubuntu·udp
予枫的编程笔记1 天前
【Linux入门篇】Linux入门不踩坑:内核、发行版解析+环境搭建全流程
linux·ubuntu·centos·vmware·xshell·linux入门·linux环境搭建
毕设源码-朱学姐1 天前
【开题答辩全过程】以 基于Node.js的书籍分享平台设计与实现为例,包含答辩的问题和答案
node.js
hampeter1 天前
【填坑指南】Trae/VS Code 远程连接 Ubuntu,终端总是自动激活特定的 Conda 环境?三招教你彻底解决!
linux·ubuntu·conda·trae
咔咔一顿操作1 天前
轻量无依赖!autoviwe 页面自适应组件实战:从安装到源码深度解析
javascript·arcgis·npm·css3·html5
前端 贾公子1 天前
Node.js 如何处理 ES6 模块
前端·node.js·es6
Mr_liu_6661 天前
ubuntu:beyond compare 4 This license key has been revoked——————转载拼接
linux·运维·ubuntu
周杰伦的稻香1 天前
Hexo搭建教程
java·node.js