安装操作系统:
debian Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
我正在使用Verdaccio 4.3.4
npmproxy@npm:~/verdaccio$ verdaccio
warn --- config file - /home/npmproxy/verdaccio/config.yaml
warn --- Verdaccio started
warn --- Plugin successfully loaded: verdaccio-htpasswd
warn --- Plugin successfully loaded: verdaccio-audit
warn --- http address - http://0.0.0.0:4873/ - verdaccio/4.3.4
fatal--- cannot create server: listen EADDRINUSE: address already in use 0.0.0.0:4873
我可以在我的私人npm Verdaccio上发布、取消发布新图书馆。
verdaccio依赖
现在,我正试图在verdaccio上为一个新项目部署我自己的库,但我随时都会得到:
$ npm install @xyz/test-lib
npm ERR! code E404
npm ERR! 404 Not Found - GET https://npm.xyz.com/flatted - no such package available
npm ERR! 404
npm ERR! 404 'flatted@^2.0.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@xyz/test-lib'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
Verdaccio不想到达https://registry.npmjs.org检索未在verdaccio上发布的库。
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '@xyz/test-lib'
1 verbose cli ]
2 info using npm@6.14.5
3 info using node@v14.5.0
4 verbose npm-session 2ca27dbe8c627033
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://npm.xyz.com/@xyz%2ftest-lib 107ms (from cache)
8 silly pacote tag manifest for @xyz/test-lib@latest fetched in 124ms
9 timing stage:loadCurrentTree Completed in 155ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule @xyz/test-lib@10.0.0 checking installable status
17 http fetch GET 404 https://npm.xyz.com/flatted 47ms
18 http fetch GET 404 https://npm.xyz.com/jest-coverage-badges 47ms
19 http fetch GET 404 https://npm.xyz.com/uuid 44ms
20 http fetch GET 404 https://npm.xyz.com/moment 48ms
21 http fetch GET 404 https://npm.xyz.com/lodash 51ms
22 http fetch GET 404 https://npm.xyz.com/winston-transport 45ms
23 http fetch GET 404 https://npm.xyz.com/winston-daily-rotate-file 47ms
24 http fetch GET 404 https://npm.xyz.com/winston 54ms
25 http fetch GET 404 https://npm.xyz.com/flatted 14ms
26 http fetch GET 404 https://npm.xyz.com/jest-coverage-badges 14ms
27 http fetch GET 404 https://npm.xyz.com/uuid 12ms
28 silly fetchPackageMetaData error for flatted@^2.0.1 404 Not Found - GET https://npm.xyz.com/flatted - no such package available
29 http fetch GET 404 https://npm.xyz.com/moment 13ms
30 silly fetchPackageMetaData error for jest-coverage-badges@1.1.2 404 Not Found - GET https://npm.xyz.com/jest-coverage-badges - no such package available
31 silly fetchPackageMetaData error for uuid@^3.3.3 404 Not Found - GET https://npm.xyz.com/uuid - no such package available
32 silly fetchPackageMetaData error for moment@^2.24.0 404 Not Found - GET https://npm.xyz.com/moment - no such package available
33 http fetch GET 404 https://npm.xyz.com/lodash 12ms
34 silly fetchPackageMetaData error for lodash@^4.17.15 404 Not Found - GET https://npm.xyz.com/lodash - no such package available
35 http fetch GET 404 https://npm.xyz.com/winston-transport 12ms
36 silly fetchPackageMetaData error for winston-transport@^4.3.0 404 Not Found - GET https://npm.xyz.com/winston-transport - no such package available
37 http fetch GET 404 https://npm.xyz.com/winston-daily-rotate-file 13ms
38 silly fetchPackageMetaData error for winston-daily-rotate-file@^4.2.1 404 Not Found - GET https://npm.xyz.com/winston-daily-rotate-file - no such package available
39 http fetch GET 404 https://npm.xyz.com/winston 12ms
40 silly fetchPackageMetaData error for winston@^3.2.1 404 Not Found - GET https://npm.xyz.com/winston - no such package available
41 http fetch GET 404 https://npm.xyz.com/circular-json 10045ms attempt #2
42 http fetch GET 404 https://npm.xyz.com/circular-json 6ms
43 silly fetchPackageMetaData error for circular-json@^0.5.9 404 Not Found - GET https://npm.xyz.com/circular-json - no such package available
44 timing stage:rollbackFailedOptional Completed in 1ms
45 timing stage:runTopLevelLifecycles Completed in 10219ms
46 silly saveTree test
46 silly saveTree `-- @xyz/test-lib@10.0.0
47 verbose stack Error: 404 Not Found - GET https://npm.xyz.com/flatted - no such package available
47 verbose stack at C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-registry-fetchcheck-response.js:104:15
47 verbose stack at processTicksAndRejections (internal/process/task_queues.js:93:5)
48 verbose statusCode 404
49 verbose pkgid flatted@^2.0.1
50 verbose cwd C:Gitxyztest
51 verbose Windows_NT 10.0.18363
52 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "@xyz/test-lib"
53 verbose node v14.5.0
54 verbose npm v6.14.5
55 error code E404
56 error 404 Not Found - GET https://npm.xyz.com/flatted - no such package available
57 error 404
58 error 404 'flatted@^2.0.1' is not in the npm registry.
59 error 404 You should bug the author to publish it (or use the name yourself!)
60 error 404 It was specified as a dependency of '@xyz/test-lib'
61 error 404 Note that you can also install from a
62 error 404 tarball, folder, http url, or git url.
63 verbose exit [ 1, true ]
config.yaml是:
#
# This is the default config file. It allows all users to do anything,
# so don't use it on production systems.
#
# Look here for more config file examples:
# https://github.com/verdaccio/verdaccio/tree/master/conf
#
# path to a directory with all packages
storage: ./storage
# path to a directory with plugins to include
plugins: ./plugins
# npm proxy listen
listen:
- 0.0.0.0:4873
#
http_proxy: http://npm.xyz.com
https_proxy: https://npm.xyz.com
no_proxy: localhost, 127.0.0.1
web:
enable: true
title: Verdaccio - npm.xyz.com
# logo: logo.png
primary_color: "#4b5e40"
gravatar: true
# scope: "@xyz"
sort_packages: asc
auth:
htpasswd:
file: ./htpasswd
# Maximum amount of users allowed to register, defaults to "+inf".
# You can set this to -1 to disable registration.
max_users: -1
security:
api:
jwt:
sign:
expiresIn: 60d
notBefore: 1
web:
sign:
expiresIn: 7d
# a list of other known repositories we can talk to
uplinks:
npmjs:
#url: https://npm.xyz.com/
url: https://registry.npmjs.org/
publish:
allow_offline: true
packages:
'@*/*':
# scoped packages
access: $authenticated
publish: $authenticated
unpublish: $authenticated
proxy: npmjs
'**':
# allow all users (including non-authenticated users) to read and
# publish all packages
#
# you can specify usernames/groupnames (depending on your auth plugin)
# and three keywords: "$all", "$anonymous", "$authenticated"
access: $authenticated
# allow all known users to publish/publish packages
# (anyone can register by default, remember?)
publish: $authenticated
unpublish: $authenticated
# if package is not available locally, proxy requests to 'npmjs' registry
proxy: npmjs
# You can specify HTTP/1.1 server keep alive timeout in seconds for incoming connections.
# A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.
# WORKAROUND: Through given configuration you can workaround following issue https://github.com/verdaccio/verdaccio/issues/301. Set to 0 in case 60 is not enough.
server:
keepAliveTimeout: 60
middlewares:
audit:
enabled: true
# log settings
logs:
- { type: stdout, format: pretty, level: http }
#- {type: file, path: verdaccio.log, level: info}
#experiments:
# # support for npm token command
# token: false
您的错误显示:npm ERR!404未找到-获取https://npm.xyz.com/flatted-没有可用的此类包装
这似乎表明您已经激活了另一个配置行。尝试做:
npm set registry <your registry>
npm login
npm publish
我不得不说,文件中完全不清楚这应该如何运作。这个包似乎需要在上游配置中,要添加它,你需要使用一个更新的版本。
还有:
17 http fetch GET 404 https://npm.xyz.com/flatted 47ms
似乎表明它从您的注册表中获取,然后找不到版本。也许您应该在注册表中删除它以获得上游版本,或者使用正确的版本。