gpt4 book ai didi

node.js - verdaccio 无法启动,出现错误 "Cannot find module"

转载 作者:太空宇宙 更新时间:2023-11-04 02:06:12 26 4
gpt4 key购买 nike

我收到此错误,verdaccio 刚刚崩溃,服务器重新启动后不再工作。当我尝试 pm2 启动 verdaccio 时,出现以下错误

Error: Cannot find module '/home/ec2-user/verdaccio'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Object.<anonymous> (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:53:21)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:427:7)

npm 配置ls

; cli configs
scope = ""
user-agent = "npm/4.2.0 node/v7.10.0 linux x64"

; userconfig /home/ec2-user/.npmrc
http-proxy = null
https-proxy = null
registry = "https://registry.npmjs.org/"
strict-ssl = false

; globalconfig /usr/etc/npmrc
registry = "https://registry.npmjs.org/"

; node bin location = /usr/bin/node
; cwd = /home/ec2-user/verdaccio
; HOME = /home/ec2-user
; "npm config ls -l" to show all defaults.

pm2 显示 verdaccio

│ name              │ verdaccio                                      │
│ restarts │ 255 │
│ uptime │ 0 │
│ script path │ /home/ec2-user/verdaccio │
│ script args │ N/A │
│ error log path │ /home/ec2-user/.pm2/logs/verdaccio-error-0.log │
│ out log path │ /home/ec2-user/.pm2/logs/verdaccio-out-0.log │
│ pid path │ /home/ec2-user/.pm2/pids/verdaccio-0.pid │
│ interpreter │ node │
│ interpreter args │ N/A │
│ script id │ 0 │
│ exec cwd │ /home/ec2-user │
│ exec mode │ fork_mode │
│ node.js version │ 7.10.0 │
│ watch & reload │ ✘ │
│ unstable restarts │ 0 │
│ created at │ N/A

`

我的配置文件如下:

storage: ./storage

auth:
htpasswd:
file: ./htpasswd


uplinks:
npmjs:
url: https://registry.npmjs.org/

packages:
'av-*':
allow_access: $all
allow_publish: $all

'*':
allow_access: $all
allow_publish: $all
proxy: npmjs

'@*/*':
allow_access: $all
allow_publish: $authenticated
proxy: npmjs


https:
key: /home/ec2-user/verdaccio/verdaccio-keynew.pem
cert: /home/ec2-user/verdaccio/verdaccio-certnew.pem
ca: /home/ec2-user/verdaccio/server.ca


logs:
- {type: stdout, format: pretty, level: http}
#- {type: file, path: verdaccio.log, level: info}

listen:
- https://devnpm2:4873

max_body_size: 300mb

最佳答案

它找不到 verdaccio 可执行文件,要找到它,您可以使用 which命令。

为此,您应该尝试:

pm2 start `which verdaccio`

关于node.js - verdaccio 无法启动,出现错误 "Cannot find module",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44273846/

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