Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.
If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!
npm publish failing after changing url
-
Hi, im trialing proget locally on my machine, it installed with the default localhost:8624. I tried changing this url with the inedo hub configuration page but every time i click save the urls box just goes red and nothing is changed.
instead, i altered the binding in iis manually, and found C:\ProgramData\Inedo\SharedConfig\ProGet.Config and updated that as well
the website is working correctly on the new url, and npm install with the npm feed i set up works
but whenever i try to publish, the npm client it fails as it is still trying to access the old localhost:8624 address, even though i've set the registry to the new address:
<redacted> > npm --registry http://local.proget.net/npm/private-npm/ publish npm notice npm notice package: @<redacted>@1.0.11 npm notice === Tarball Contents === npm notice 169B index.js npm notice 557B package.json npm notice 329B readme.md npm notice 78B readme.template.md npm notice === Tarball Details === npm notice name: @<redacted> npm notice version: 1.0.11 npm notice package size: 777 B npm notice unpacked size: 1.1 kB npm notice shasum: 4c7b63635e1805bf0f8a0b95b469c11788e65468 npm notice integrity: sha512-236SSsDjj2Ll5[...]wxodSscT16/EQ== npm notice total files: 4 npm notice npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to http://localhost:8624/npm/private-npm/@<redacted> failed, reason: connect ECONNREFUSED 127.0.0.1:8624 npm ERR! at ClientRequest.<anonymous> (C:\Users\<redacted>\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:209:13) npm ERR! at Socket.socketErrorListener (_http_client.js:406:9) npm ERR! at Socket.emit (events.js:209:13) npm ERR! at emitErrorNT (internal/streams/destroy.js:91:8) npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21) npm ERR! FetchError: request to http://localhost:8624/npm/private-npm/@<redacted> failed, reason: connect ECONNREFUSED 127.0.0.1:8624 npm ERR! at ClientRequest.<anonymous> (C:\Users\<redacted>\AppData\Roaming\npm\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:209:13) npm ERR! at Socket.socketErrorListener (_http_client.js:406:9) npm ERR! at Socket.emit (events.js:209:13) npm ERR! at emitErrorNT (internal/streams/destroy.js:91:8) npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:59:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21) { npm ERR! message: 'request to http://localhost:8624/npm/private-npm/@<redacted> failed, reason: connect ECONNREFUSED 127.0.0.1:8624', npm ERR! type: 'system', npm ERR! errno: 'ECONNREFUSED', npm ERR! code: 'ECONNREFUSED', npm ERR! stack: 'FetchError: request to http://localhost:8624/npm/private-npm/@<redacted> failed, reason: connect ECONNREFUSED 127.0.0.1:8624\n' + npm ERR! ' at ClientRequest.<anonymous> (C:\\Users\\<redacted>\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-fetch-npm\\src\\index.js:68:14)\n' + npm ERR! ' at ClientRequest.emit (events.js:209:13)\n' + npm ERR! ' at Socket.socketErrorListener (_http_client.js:406:9)\n' + npm ERR! ' at Socket.emit (events.js:209:13)\n' + npm ERR! ' at emitErrorNT (internal/streams/destroy.js:91:8)\n' + npm ERR! ' at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)\n' + npm ERR! ' at processTicksAndRejections (internal/process/task_queues.js:80:21)' npm ERR! } npm ERR! npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config' npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\<redacted>\AppData\Roaming\npm-cache\_logs\2020-06-17T11_23_37_360Z-debug.log
-
Hello;
The InedoHub just edits that ProGet.Config file; but in any case, those bindings are only used for the integrated web server, not IIS. We should definitely improve that experience so it's clearer. Are you able to access your instance via
http://local.proget.net/
in a browser? If so, then, it seems to have worked.I don't know npm very well, but I looked at the docs of
[npm publish](https://docs.npmjs.com/cli/publish)
, and it seems that--registry
isn't an option on that page. But there's also this page: https://docs.npmjs.com/misc/registryHope that helps
-
@atripp --registry is just the global arg for swapping out your registry on a per-command basis (instead of in a config file).
But! i just realised what was wrong, apologies it's all on me. I still had the old url hardcoded in the
publishConfig.registry
key in the test modules package.json. i didn't realise that would make npm completely ignore the --registry arg, and blindly try and publish to the old registry address! which was whynpm install
etc were all working totally fine