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 / 问题

问题[npm](ubuntu)

Martin Hope
NiveditaK
Asked: 2022-03-10 05:25:59 +0800 CST

需要帮助才能在 Ubuntu 中安装 npm require-in-the-middle

  • 0
User@userAcc-Dummy:/$ sudo apt-get install npm require-in-the-middle
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package require-in-the-middle
npm
  • 1 个回答
  • 64 Views
Martin Hope
claytoncarney
Asked: 2021-12-13 21:29:13 +0800 CST

npm http-server 在 ubuntu 20.04.3 LTS 上不起作用

  • 2

多年来,我一直在 Windows 上使用http-server 。今天我在 ubuntu 上安装了 http-server,但它不起作用。它的初始化与在 Windows 上完全相同。但是,当我导航到本地网站 ( http://127.0.0.1:8080 ) 时出现错误。这在 Windows 上不会发生。知道如何解决这个问题吗?

clayton@u20:~/hello-pwa-master$ http-server
Starting up http-server, serving ./

http-server version: 14.0.0

http-server settings: 
CORS: disabled
Cache: 3600 seconds
Connection Timeout: 120 seconds
Directory Listings: visible
AutoIndex: visible
Serve GZIP Files: false
Serve Brotli Files: false
Default File Extension: none

Available on:
  http://127.0.0.1:8080
  http://192.168.4.54:8080
Hit CTRL-C to stop the server

[Sun Dec 12 2021 22:12:15 GMT-0700 (Mountain Standard Time)]  "GET /" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"
_http_outgoing.js:470
    throw new ERR_HTTP_HEADERS_SENT('set');
    ^

Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at ServerResponse.setHeader (_http_outgoing.js:470:11)
    at module.exports.ResponseStream.(anonymous function) [as setHeader] (/usr/local/lib/node_modules/http-server/node_modules/union/lib/response-stream.js:100:34)
    at Object.exports.(anonymous function) (/usr/local/lib/node_modules/http-server/lib/core/status-handlers.js:57:7)
    at Readable.stream.on (/usr/local/lib/node_modules/http-server/lib/core/index.js:339:22)
    at Readable.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm
  • 1 个回答
  • 977 Views
Martin Hope
Rudrakshi
Asked: 2021-01-22 20:54:22 +0800 CST

从您的工作区终端登录到 netlify

  • 0

我netlify login在终端中使用过,但它给出了错误 - netlify: command not found。我还使用此命令安装了 netlify CLI - npm install netlify-cli -g但仍然出现此错误。

npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: "Please update to latest v2.3 or v2.2"
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-inject.
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/netlify-cli
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/netlify-cli/node_modules/@netlify
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/netlify-cli/node_modules/chokidar/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/netlify-cli/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/netlify-cli/node_modules/rollup/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @netlify/traffic-mesh-agent-darwin-x64@^0.27.10 (node_modules/netlify-cli/node_modules/@netlify/traffic-mesh-agent/node_modules/@netlify/traffic-mesh-agent-darwin-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @netlify/[email protected]: wanted {"os":"darwin","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @netlify/traffic-mesh-agent-win32-x64@^0.27.10 (node_modules/netlify-cli/node_modules/@netlify/traffic-mesh-agent/node_modules/@netlify/traffic-mesh-agent-win32-x64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @netlify/[email protected]: wanted {"os":"win32","arch":"x64"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.1 (node_modules/netlify-cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN @octokit/[email protected] requires a peer of @octokit/core@>=3 but none is installed. You must install peer dependencies yourself.

npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/netlify-cli
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/netlify-cli'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/netlify-cli']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/netlify-cli\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/netlify-cli' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rudrakshi/.npm/_logs/2021-01-22T05_32_03_765Z-debug.log
rudrakshi@rudrakshi-pc:~$ netlify
netlify: command not found
rudrakshi@rudrakshi-pc:~$ npm install http-server -g
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { [Error: EACCES: permission denied, access '/usr/local/lib/node_modules']
npm ERR!   stack:
npm ERR!    'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rudrakshi/.npm/_logs/2021-01-22T05_34_54_847Z-debug.log


npm
  • 1 个回答
  • 340 Views
Martin Hope
duffymo
Asked: 2020-10-30 16:47:52 +0800 CST

在 Ubuntu 上安装 express-generator 的问题

  • 1

我在 Ubuntu 20.10 上安装了 Graal JVM。

我尝试安装 express-generator,但收到以下错误消息:

$ npm install -g express-generator
bash: /usr/lib/jvm/graalvm/bin/npm: No such file or directory

确实,没有npm目录。

我想删除 graal 并尝试重新安装或使用另一个 JVM。

如果我使用dpkg --list.

这是否意味着我可以简单地删除/graal文件夹而不会造成伤害?

更新:

看到接受的答案后,我从 PATH 中删除了 Graal,从 中删除了 Graal 文件夹/usr/lib/jvm,并将我的默认设置更改为 OpenJDK 13。

一旦我这样做了,express-generator 安装就可以完美运行。

software-installation npm 20.10
  • 1 个回答
  • 78 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
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
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
alex
Asked: 2020-06-04 15:37:39 +0800 CST

如何解决安装电子的这个 npm 错误?

  • 1

当我使用npm install electron -g时,我得到这个错误:

npm ERR! code EEXIST
npm ERR! path /usr/local/bin/electron
npm ERR! Refusing to delete /usr/local/bin/electron: ../lib/node_modules/electron-prebuilt/cli.js symlink target is not controlled by npm /usr/local/bin
npm ERR! File exists: /usr/local/bin/electron
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-06-03T23_17_02_469Z-debug.log
software-installation npm electron
  • 1 个回答
  • 1949 Views
Martin Hope
Qumber
Asked: 2020-03-01 04:36:24 +0800 CST

Atom 无法在 Ubuntu 上安装任何软件包(错误代码 ELIFECYCLE)

  • 1

今天,突然间,Atom 根本无法安装任何软件包。它以前可以正常工作,我已经安装了一些软件包。但现在它失败了Exit status 134。无论我尝试安装什么软件包,都会发生这种情况。我试过 Hydrogen 和 Atom Beautify,

我尝试了 Atom 设置中的 GUI 以及apm install ...(使用和不使用 sudo)。

这是堆栈跟踪:

> [email protected] postinstall /tmp/apm-install-dir-120129-5590-622axg.s39i7/node_modules/atom-beautify/node_modules/core-js
> node -e "try{require('./postinstall')}catch(e){}"


npm WARN deprecated [email protected]: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated [email protected]: No longer maintained. We recomment migrating to ESLint with eslint-config-wikimedia.
npm WARN deprecated [email protected]: Package no longer supported. Contact [email protected] for more info.
npm WARN deprecated [email protected]: CoffeeScript on NPM has moved to "coffeescript" (no hyphen)
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
Aborted (core dumped)
npm WARN enoent ENOENT: no such file or directory, open '/tmp/apm-install-dir-120129-5590-622axg.s39i7/package.json'
npm WARN apm-install-dir-120129-5590-622axg.s39i7 No description
npm WARN apm-install-dir-120129-5590-622axg.s39i7 No repository field.
npm WARN apm-install-dir-120129-5590-622axg.s39i7 No README data
npm WARN apm-install-dir-120129-5590-622axg.s39i7 No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! [email protected] postinstall: `node -e "try{require('./postinstall')}catch(e){}"`
npm ERR! Exit status 134
npm ERR! 
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.atom/.apm/_logs/2020-02-29T09_58_40_245Z-debug.log

日志文件的最后几行具有完全相同的堆栈。

我怀疑的一件事是我最近安装NodeJS了npm一个 Angular 项目。这会导致问题吗?

我在 Pop!_OS ( Ubuntu)上19.10,使用npm 6.13.6, 和Node v10.15.2.
Hittingatom -v给了我这个(注意 Node 版本与上面版本之间的区别):
Atom : 1.43.0 Electron: 4.2.7 Chrome : 69.0.3497.128 Node : 10.11.0


更新: apm install language-vue工作但apm install atom-beautify仍然apm install hydrogen失败。不知道这里有什么问题。

任何建议都会很可爱。提前致谢。:)

npm atom
  • 1 个回答
  • 992 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