AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[nodejs](ubuntu)

Martin Hope
Aakash
Asked: 2021-05-31 21:55:00 +0800 CST

在新系统上 sudo apt install nodejs 不工作

  • 2

在此处输入图像描述

我要安装节点版本 10.16.3

  • 所以我正在尝试使用 nvm 安装,但我的节点 js 向我显示了这个错误
Command 'nodejs' not found, but can be installed with:

sudo apt install nodejs

我已经安装了nodejs我仍然收到这个错误

nodejs
  • 2 个回答
  • 1788 Views
Martin Hope
ntg
Asked: 2021-02-25 23:59:15 +0800 CST

如何在 Ubuntu 中完全逆转 npm 的所有更改

  • 6

问题类似于https://stackoverflow.com/questions/11177954/how-do-i-completely-uninstall-node-js-and-reinstall-from-beginning-mac-os-x但对于 Ubuntu,主要是涉及清理部分。

安装照常由: 完成sudo apt-get install node,但是我后来使用该npm命令以多个用户的身份安装多个软件包。

如何完全删除 npm 以及 npm 在我的系统上安装的所有库、包和任何其他文件,例如npm install -g @vue/cli?我可能不得不从 卸载apt,但主要问题与所做的所有更改有关npm。

笔记:

  1. 如果这很重要,我在 Ubuntu 20.04 LTS npm 版本 7.5.6
  2. 由于目前似乎有一些关于人们卸载 npm 的争论,请不要仅仅因为我想卸载而投反对票,我打算重新安装 :)

编辑提醒未来的自己和他人:对于没有 sudo 的重新安装,可以在此处找到带有食谱的链接。我仍然不清楚什么是最好的,但另一方面https://stackoverflow.com/questions/10081293/install-npm-into-home-directory-with-distribution-nodejs-package-ubuntu有README.md# debinstall所以可能使用 apt 安装节点,然后使用前缀...

nodejs
  • 2 个回答
  • 1291 Views
Martin Hope
Igor Stakic
Asked: 2020-10-12 08:02:35 +0800 CST

不能在项目中使用 npm install

  • 0

我已经使用 nvm 安装了节点,但是当我进入我的项目文件夹并尝试运行 npm install 时,它显示未找到 npm。

但是,我尝试使用 sudo npm install -g gulp 安装 gulp globaly 它有效。

当我使用 which npm 它显示 /home/USER/.nvm/versions/node/v14.13.1/bin/npm

如何克服这个问题并能够在我的项目文件夹中使用 npm install ?

nodejs npm 18.04
  • 1 个回答
  • 187 Views
Martin Hope
Igor Stakic
Asked: 2020-10-11 10:40:06 +0800 CST

从 ubuntu 18.04 中删除 node 和 nodejs

  • 0

我有节点并nodejs安装在我的 Ubuntu 18.04 机器上。我想删除它和/或重新安装它以获得最新nodejs版本。

  • 当我运行node -v它给我:v12.18.4
  • 当我运行nodejs -v它给我:v8.10.0

还

  • which node返回/usr/local/bin/node
  • which nodejs返回/usr/bin/nodejs

我试图卸载它们

sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs

但sudo apt-get --purge remove node给了我

E: Unable to locate package node

并sudo apt-get --purge remove nodejs返回

npm : Depends: nodejs but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

有什么解决办法吗?

nodejs 18.04
  • 1 个回答
  • 1159 Views
Martin Hope
Tom Dickson
Asked: 2020-08-25 21:17:28 +0800 CST

为什么 NPM 会安装这么多包?

  • 4

在 Ubuntu 20.04 上部署 Node 和 NPM 时,我注意到当你运行sudo apt install npm它时,它会详细说明它想要与它一起安装的大量依赖项。为什么是这样?当然它不需要所有这些包来运行包管理器吗?

apt nodejs npm
  • 1 个回答
  • 1674 Views
Martin Hope
Mike
Asked: 2020-08-10 12:10:50 +0800 CST

如何在 Ubuntu 20.04 上将 Node.js 更新为长期支持版本?

  • 21

我对 Ubuntu 很陌生。我可以将 Node.js 安装到最新版本 14.7.0 但我正在使用的程序(Jhipster)告诉我需要安装长期支持(LTS,目前是 12.18.3)并且不知道如何去做吧。

Windows中有一个node-v12.18.3-linux-x64.tar.xz文件,看起来像一个zip文件,但我不知道如何安装它(文件管理器打开时它不会自行安装)

我试图用谷歌搜索如何选择版本,但我可以找到如何去做。请为傻瓜解释一下。谢谢。

nodejs
  • 4 个回答
  • 65245 Views
Martin Hope
Hairi
Asked: 2020-07-18 03:45:59 +0800 CST

为什么我的 Ubuntu 机器上安装了旧的 Nodejs 版本 [重复]

  • 3
这个问题在这里已经有了答案:
为什么 Ubuntu 存储库没有最新版本的软件? (6 个回答)
如何安装最新版本的 node.js? (16 个答案)
2年前关闭。

我在我的 Ubuntu 上安装了 Nodejs:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.6 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.6 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial

使用以下命令:

sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm

结果是:

$ nodejs -v
v4.2.6

在互联网上,我看到有很多更新的版本https://nodejs.org/en/download/releases/。所以,

  1. 为什么默认安装这样的旧版本
  2. 如何安装较新的?

谢谢!

apt 16.04 nodejs
  • 2 个回答
  • 3386 Views
Martin Hope
Alex
Asked: 2020-07-14 20:29:43 +0800 CST

Ubuntu 20.04 我应该将 libssl1.1 降级到 libssl1.0 以安装 npm 吗?

  • 3

我正在尝试安装 npm 并找到了这个解决方案。我跑aptitude install npm了,建议的解决方案是

The following packages have unmet dependencies:
 libssl-dev : Depends: libssl1.1 (= 1.1.1f-1ubuntu2) 
but 1.1.1g-1+ubuntu18.04.1+deb.sury.org+1 is installed

     Keep the following packages at their current version:
1)     libnode-dev [Not Installed]                        
2)     libssl-dev [Not Installed]                         
3)     node-gyp [Not Installed]                           
4)     npm [Not Installed]                                



Accept this solution? [Y/n/q/?] 

它基本上是在建议降级,但是如果我将 libssl1.1 降级到 libssl1.0 会对我的系统产生什么影响?

编辑:将 Ubuntu 18.04 升级到 20.04 后出现此问题。Dan Scally的解决方案有效,我还在启动板的评论中提供了另一个选项,其中针对我的特定情况提供了更详细的信息。

package-management lts nodejs npm 20.04
  • 2 个回答
  • 11473 Views
Martin Hope
Bala Ganesh
Asked: 2020-07-11 03:04:11 +0800 CST

安装节点 js 和 npm 时出现哈希和不匹配错误

  • 1
Err:37 http://archive.ubuntu.com/ubuntu focal/main DEP-11 64x64 Icons
  Hash Sum mismatch
  Hashes of expected file:
   - Filesize:162899 [weak]
   - SHA256:9f4ffba2a05dc2fb76857d4b30ed55724fe6e2999341694f2b86940ab067a44b
   - SHA1:f470f9b518e5cd213a66334f3a5e3b671c4dbe61 [weak]
   - MD5Sum:504d24e4682a64a0559d13f7cf1e5ca6 [weak]
  Hashes of received file:
   - SHA256:0d49809352ede8d21c648de700d0d16fe10c2394064b1bc457331e0565419e3a
   - SHA1:fd8bebb3573711be3d667718e13250cd7ae6b629 [weak]
   - MD5Sum:747cd4f065cae49a271e9b46cc88c6d6 [weak]
   - Filesize:162899 [weak]
  Last modification reported: Mon, 20 Apr 2020 09:35:48 +0000
  Release file created at: Thu, 23 Apr 2020 17:33:17 +0000

.
.
.
.
.
.
.

 E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/focal/main/dep11/by-hash/SHA256/9f4ffba2a05dc2fb76857d4b30ed55724fe6e2999341694f2b86940ab067a44b  Hash Sum mismatch
       Hashes of expected file:
        - Filesize:162899 [weak]
        - SHA256:9f4ffba2a05dc2fb76857d4b30ed55724fe6e2999341694f2b86940ab067a44b
        - SHA1:f470f9b518e5cd213a66334f3a5e3b671c4dbe61 [weak]
        - MD5Sum:504d24e4682a64a0559d13f7cf1e5ca6 [weak]
       Hashes of received file:
        - SHA256:0d49809352ede8d21c648de700d0d16fe10c2394064b1bc457331e0565419e3a
        - SHA1:fd8bebb3573711be3d667718e13250cd7ae6b629 [weak]
        - MD5Sum:747cd4f065cae49a271e9b46cc88c6d6 [weak]
        - Filesize:162899 [weak]
       Last modification reported: Mon, 20 Apr 2020 09:35:48 +0000
       Release file created at: Thu, 23 Apr 2020 17:33:17 +0000
    E: Some index files failed to download. They have been ignored, or old ones used instead.

我已经尝试了其他答案中提供的所有可能的解决方案,但问题仍然存在。我正在使用 ubuntu 20.04。我是 Linux 环境的新手,所以我对 Linux 系统和术语了解不多。

我试图安装节点 js 和 npm。我在使用 apt-get 时遇到了很多问题。

问题:

  1. 使用 apt-get 安装后找不到 npm 命令

    Command 'npm' not found, did you mean:
    
      command 'apm' from snap atom (1.48.0)
      command 'nsm' from snap nift (2.3.10)
    
    See 'snap info <snapname>' for additional versions.
    
  2. 当我尝试安装sudo apt-get install python-software-properties

    我有,

     Reading package lists... Done
        Building dependency tree       
        Reading state information... Done
        Some packages could not be installed. This may mean that you have
        requested an impossible situation or if you are using the unstable
        distribution that some required packages have not yet been created
        or been moved out of Incoming.
        The following information may help to resolve the situation:
    
        The following packages have unmet dependencies:
         python-software-properties : Depends: python (>= 2.7) but it is not going to be installed
                                      Depends: python (< 2.8) but it is not going to be installed
                                      Depends: python-apt (>= 0.6.20ubuntu16) but it is not going to be installed
                                      Depends: python-pycurl but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.
    
  3. 当我尝试使用单独安装 npm 时apt-get npm

       The following packages have unmet dependencies:
         npm : Depends: node-gyp (>= 0.10.9) but it is not going to be installed
        E: Unable to correct problems, you have held broken packages.
    
apt nodejs npm 20.04
  • 1 个回答
  • 751 Views
Martin Hope
Önder Sümer
Asked: 2020-05-07 08:49:38 +0800 CST

如何正确设置我的 systemd 服务 ExecStart?

  • 0

我正在尝试使用 systemd 服务设置服务,但出现错误,我无法理解它有什么问题。

[Unit]
Description=Vinematik Service
After=network.target
StartLimitIntervalSec=0

[Service]
Type=simple
Restart=always
RestartSec=1
User=buraksumer13
ExecStart=/home/buraksumer13/.nvm/versions/node/v14.2.0/bin node home/buraksumer13/Documents/vinematikIns/index.js  

[Install]
WantedBy=multi-user.target

运行时出现以下错误systemctl status vinematik:

● vinematik.service - Vinematik Service
     Loaded: loaded (/etc/systemd/system/vinematik.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Wed 2020-05-06 16:44:12 UTC; 788ms ago
    Process: 2981 ExecStart=/home/buraksumer13/.nvm/versions/node/v14.2.0/bin node /home/buraksumer13/Documents/vinematikIns/index.js (code=exited, status=203/EXEC)
   Main PID: 2981 (code=exited, status=203/EXEC)

我不明白为什么它不能启动我的脚本,我也不太确定这是否是一个错误。但我确实认为这可能与我的ExecStart生产线有关,是设置正确还是我做错了什么?

提前致谢 :)

services systemd nodejs
  • 1 个回答
  • 4784 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve