gpt4 book ai didi

node.js - bash:npm:在 Debian 9 中找不到命令

转载 作者:太空狗 更新时间:2023-10-29 12:40:12 30 4
gpt4 key购买 nike

我正在使用 Debian 9.2。我无法安装正确版本的 NodeJS,似乎我也根本无法安装 NPM。

我从终端运行了这个:

sudo curl -sL https://deb.nodesource.com/setup_9.x | sudo bash -

终端有这样的输出:

## Installing the NodeSource Node.js v9.x repo...


## Populating apt-get cache...

+ apt-get update
Hit:1 http://security.debian.org/debian-security stretch/updates InRelease
Ign:2 http://ftp.us.debian.org/debian stretch InRelease
Hit:4 http://ftp.us.debian.org/debian stretch-updates InRelease
Ign:5 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic InRelease
Hit:6 http://ftp.us.debian.org/debian stretch Release
Hit:7 https://download.sublimetext.com apt/stable/ InRelease
Ign:3 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Hit:8 http://cdn-fastly.deb.debian.org/debian stretch Release
Ign:10 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic Release
Hit:12 https://deb.opera.com/opera-stable stable InRelease
Ign:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Ign:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Ign:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Ign:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Ign:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Err:13 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main amd64 Packages
404 Not Found
Ign:14 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main all Packages
Ign:15 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en
Ign:16 http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic/main Translation-en_US
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/developmentseed/mapbox/ubuntu bionic Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/developmentseed/mapbox/ubuntu/dists/bionic/main/binary-amd64/Packages 404 Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
Error executing command, exiting

然后我运行了 sudo apt-get install -y nodejs

node -v 的输出:

bash: node: command not found

nodejs -v 的输出:

v4.8.2

npm -v 的输出:

bash: npm: command not found

如何在 Debian 9.2 上安装正确版本的 NodeJS 和 NPM?

最佳答案

在 linux 上安装 node 时,npm 不会像在 windows 上那样打包。尝试 -> sudo apt-get install npm ,然后试一试。

关于node.js - bash:npm:在 Debian 9 中找不到命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47948077/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com