question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VERDACCIO : ERROR 404 when trying to make npm install @xyz/mylib

See original GitHub issue

Installation OS :

debian Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster I am using 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
I am able to publish, unpublish new library on my private npm Verdaccio.

verdaccio - dependencies

Now, I am trying to deploy my own library available on verdaccio on a new project but I get at any time :

image

$ 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 doesn’t want to reach the https://registry.npmjs.org to retrieve the libraries not published on the 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 Files\nodejs\node_modules\npm\node_modules\npm-registry-fetch\check-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:\Git\xyz\test
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 ]

The config.yaml is :

#
# 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

I tried also to verify if the private verdaccio could reach the https://registry.npmjs.org and he does.

npmproxy@npm:~/verdaccio$ curl https://registry.npmjs.org
{"db_name":"registry","doc_count":1738495,"doc_del_count":339,"update_seq":13869312,"purge_seq":0,"compact_running":false,"disk_size":397247389831,"data_size":29733128898,"instance_start_time":"1593434531849430","disk_format_version":6,"committed_update_seq":13869312}npmproxy@npm:~/verdaccio$

Any idea.

Best regards Youssef

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
VGerriscommented, Apr 21, 2021

It would be of great help if there is clear documentation on how to publish something and with what syntax. I found multiple posts with this issue and no solution. I just tried to publish a simple package and got this issue without any clear understanding of why and the exact cause. I just need an npm repo to put npm packages in and thought it would “just work”. Eventually after trial and error I got an existing package to load up by upping the version compared to the one in the package, based on the error, with no clear understanding of the why. May I suggest adding simply docs about:

  • function of server - what the hell is it supposed to do by itself and with an ‘upstream’ npm repo set? - I thought it would just mix own uploads and npm packages as proxy - does it?
  • publish command examples with @something , explanation of what it means and the prerequisites. thanks
1reaction
BlueBeN82commented, Sep 29, 2021

Ok… found the solution for my case. Config did contain a custom proxy for ‘@/’ which was not reachable

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ask Question - Stack Overflow
Now, I am trying to deploy my own library available on verdaccio on a new project but I get at any time :...
Read more >
Installation - Verdaccio
Verdaccio is a Node.js private and proxy registry. To install it, you need a few basic prerequisites.
Read more >
verdaccio - Bountysource
I installed Verdaccio using npm install -g verdaccio and it runs fine, I can access the web interface. Now I want to add...
Read more >
serve-handler - npm
Get started by installing the package using yarn: yarn add serve-handler ... symlinks, Resolve symlinks instead of rendering a 404 error.
Read more >
How to resolve NPM proxy issue whilel running node JS ...
If you have a proxy on your network, then you have to provide its internal ... Then try to run your npm install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found