gpt4 book ai didi

node.js - E : Unable to locate package npm

转载 作者:IT老高 更新时间:2023-10-28 21:53:30 25 4
gpt4 key购买 nike

当我尝试使用 sudo apt-get install npm 安装 npm 时,出现以下错误:

E: Unable to locate package npm

为什么apt找不到npm?我正在使用 Debian 9 并且已经运行了

sudo apt-get install nodejs

最佳答案

来自官方 Node.js 文档:

A Node.js package is also available in the official repo for Debian Sid (unstable), Jessie (testing) and Wheezy (wheezy-backports) as "nodejs". It only installs a nodejs binary.

因此,如果您只键入 sudo apt-get install nodejs ,它不会安装其他好东西,例如 npm

您需要输入:

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

Optional: install build tools

To compile and install native add-ons from npm you may also need to install build tools:

sudo apt-get install -y build-essential

更多信息:Docs NodeJs

关于node.js - E : Unable to locate package npm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47371904/

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