I just published my package to npm via github.
The repository is this: https://github.com/diegoulloao/banana-cli
I was able to authenticate and publish and everything seemed fine, but when I installed with:
npm install @diegoulloao/[email protected] -g
Globally I get:
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@diegoulloao%2fbanana-cli - Not found
npm ERR! 404
npm ERR! 404 '@diegoulloao/[email protected]' 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
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
In the detail (log) this appears:
diego:Desktop/ $ cat /Users/diego/.npm/_logs/2020-02-20T22_59_19_345Z-debug.log [19:59:19]
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'install',
1 verbose cli '@diegoulloao/[email protected]',
1 verbose cli '-g'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 6244d0a7c6e7a1bd
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/@diegoulloao%2fbanana-cli 1831ms
8 http fetch GET 404 https://registry.npmjs.org/@diegoulloao%2fbanana-cli 1078ms
9 silly fetchPackageMetaData error for @diegoulloao/[email protected] 404 Not Found - GET https://registry.npmjs.org/@diegoulloao%2fbanana-cli - Not found
10 timing stage:rollbackFailedOptional Completed in 1ms
11 timing stage:runTopLevelLifecycles Completed in 2939ms
12 verbose stack Error: 404 Not Found - GET https://registry.npmjs.org/@diegoulloao%2fbanana-cli - Not found
12 verbose stack at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
12 verbose stack at processTicksAndRejections (internal/process/task_queues.js:85:5)
13 verbose statusCode 404
14 verbose pkgid @diegoulloao/[email protected]
15 verbose cwd /Users/diego/Desktop
16 verbose Darwin 19.2.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "@diegoulloao/[email protected]" "-g"
18 verbose node v12.8.1
19 verbose npm v6.13.7
20 error code E404
21 error 404 Not Found - GET https://registry.npmjs.org/@diegoulloao%2fbanana-cli - Not found
22 error 404
23 error 404 '@diegoulloao/[email protected]' is not in the npm registry.
24 error 404 You should bug the author to publish it (or use the name yourself!)
25 error 404 Note that you can also install from a
26 error 404 tarball, folder, http url, or git url.
27 verbose exit [ 1, true ]
I don't know what will go wrong. Apparently the package does not appear in the registries: https://registry.npmjs.org/@diegoulloao%2fbanana-cli
I get a 404 not found response from the server.
I think I added everything correctly in my package.json just like the github documentation says: https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-npm- for-use-with-github-packages .
I would appreciate reviewing those files to see if I am making any mistakes and see if you can help me please.
URL of the package that was published: https://github.com/diegoulloao/banana-cli/packages/133408
Simple. The registers of
npm
and ofGithub
are different. When you published your package where you did it was in theGithub
.When you run
npm install
and the dependency is written as<nombre>@<versión>
where it looks is in the registry configured by default.In order to consume a package from
Github
you must have followed point 2 of the guide you are reading, that is, the npm must be configured to consume fromhow
OWNER
are you you would beIf your module is public, what I recommend is that you use the default registry
npm
since it requires less configuration when installing.