You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm publish fails to pick up publishConfig.registry from my package.json, yet it works fine if I provide it in the command line with npm publish --registry=http://my-npm.repository/
I am using Angular workspaces but no matter in which package.json I place the config, it is not followed.
Expected Behavior
I am able to publish to a private NPM repository using the NPM-provided documentation
$ npm publish my-package@0.0.0 --dry-run --loglevel=silly
npm verb cli /my-user/.nvm/versions/node/v20.8.0/bin/node /my-user/.nvm/versions/node/v20.8.0/bin/npm
npm info using npm@10.1.0
npm info using node@v20.8.0
npm verb title npm publish my-package@0.0.0
npm verb argv "publish" "my-package@0.0.0" "--dry-run" "--loglevel" "silly"
npm verb logfile logs-max:10 dir:/my-user/.npm/_logs/2023-10-30T07_44_46_004Z-
npm verb logfile /my-user/.npm/_logs/2023-10-30T07_44_46_004Z-debug-0.log
npm verb publish [ 'my-package@0.0.0' ]
npm sill logfile start cleaning logs, removing 1 files
npm sill logfile done cleaning log files
npm http fetch GET 404 https://registry.npmjs.org/my-package 1536ms (cache skip)
npm http fetch GET 404 https://registry.npmjs.org/my-package 947ms (cache skip)
npm verb stack HttpErrorGeneral: 404 Not Found - GET https://registry.npmjs.org/my-package - Not found
npm verb stack at /my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verb stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm verb stack at async RegistryFetcher.packument (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:87:19)
npm verb stack at async RegistryFetcher.manifest (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:23)
npm verb stack at async Publish.getManifest (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/commands/publish.js:213:18)
npm verb stack at async Publish.exec (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/commands/publish.js:67:20)
npm verb stack at async module.exports (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/cli-entry.js:61:5)
npm verb statusCode 404
npm verb pkgid my-package@0.0.0
npm verb cwd /my-user/projects/my-package
npm verb Darwin 23.0.0
npm verb node v20.8.0
npm verb npm v10.1.0
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/my-package - Not found
npm ERR! 404
npm ERR! 404 'my-package@0.0.0' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm verb exit 1
npm verb code 1
npm ERR! A complete log of this run can be found in: /my-user/.npm/_logs/2023-10-30T07_44_46_004Z-debug-0.log
"successful" attempt at publishing
$ npm publish my-package@0.0.0 --dry-run --loglevel=silly --registry=http://my-npm.repository/
npm verb cli /my-user/.nvm/versions/node/v20.8.0/bin/node /my-user/.nvm/versions/node/v20.8.0/bin/npm
npm info using npm@10.1.0
npm info using node@v20.8.0
npm verb title npm publish my-package@0.0.0
npm verb argv "publish" "my-package@0.0.0" "--dry-run" "--loglevel" "silly" "--registry" "http://my-npm.repository/"
npm verb logfile logs-max:10 dir:/my-user/.npm/_logs/2023-10-30T07_51_12_291Z-
npm verb logfile /my-user/.npm/_logs/2023-10-30T07_51_12_291Z-debug-0.log
npm verb publish [ 'my-package@0.0.0' ]
npm sill logfile start cleaning logs, removing 1 files
npm sill logfile done cleaning log files
npm http fetch GET 404 http://my-npm.repository/my-package 2748ms (cache skip)
npm http fetch GET 404 http://my-npm.repository/my-package 312ms (cache skip)
npm verb stack HttpErrorGeneral: 404 Not Found - GET https://my-npm.repository/my-package - not_found
npm verb stack at /my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/npm-registry-fetch/lib/check-response.js:95:15
npm verb stack at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm verb stack at async RegistryFetcher.packument (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:87:19)
npm verb stack at async RegistryFetcher.manifest (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/node_modules/pacote/lib/registry.js:118:23)
npm verb stack at async Publish.getManifest (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/commands/publish.js:213:18)
npm verb stack at async Publish.exec (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/commands/publish.js:67:20)
npm verb stack at async module.exports (/my-user/.nvm/versions/node/v20.8.0/lib/node_modules/npm/lib/cli-entry.js:61:5)
npm verb statusCode 404
npm verb pkgid my-package@0.0.0
npm verb cwd /my-user/projects/my-package
npm verb Darwin 23.0.0
npm verb node v20.8.0
npm verb npm v10.1.0
npm ERR! code E404
npm ERR! 404 Not Found - GET http://my-npm.repository/my-package - not_found
npm ERR! 404
npm ERR! 404 'my-package@0.0.0' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm verb exit 1
npm verb code 1
npm ERR! A complete log of this run can be found in: /my-user/.npm/_logs/2023-10-30T07_51_12_291Z-debug-0.log
Environment
npm: 10.2.1
Node.js: v20.8.0
OS Name: macOS Sonoma 14.0
System Model Name: MacBook Pro 2021 M1
//my-npm.repository = (protected)
; node bin location = /my-user/.nvm/versions/node/v20.8.0/bin/node; node version = v20.8.0; npm local prefix = /my-user; npm version = 10.2.1; cwd = /my-user; HOME = /my-user; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
This is because you are typing the package name instead of a directory
npm publish my-package@0.0.0
When npm goes to look for publishConfig it looks at the spec you gave, and of course that won't work because it is a registry spec.
Unless you are trying to publish a package that exists in one registry into another one you would not use npm publish in this way. You would simply type npm publish or in some cases npm publish /path/to/package.
@wraithgar thank you - where can I find the documentation to make a note of this? it is completely unclear and I would like to contribute this short note to the project :)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I am having an issue similar to #1937
npm publish
fails to pick uppublishConfig.registry
from mypackage.json
, yet it works fine if I provide it in the command line withnpm publish --registry=http://my-npm.repository/
I am using Angular workspaces but no matter in which package.json I place the config, it is not followed.
Expected Behavior
I am able to publish to a private NPM repository using the NPM-provided documentation
Steps To Reproduce
package.json:
failed attempt at publishing:
"successful" attempt at publishing
Environment
The text was updated successfully, but these errors were encountered: