npm-cli-login icon indicating copy to clipboard operation
npm-cli-login copied to clipboard

Does not work on windows anymore

Open webmutation opened this issue 7 years ago • 6 comments
trafficstars

Try to run it on a Windows Bamboo agent and the config-path does not work anymore...

error 20-Feb-2018 09:28:19 TypeError: Path must be a string. Received undefined error 20-Feb-2018 09:28:19 at assertPath (path.js:7:11) error 20-Feb-2018 09:28:19 at Object.join (path.js:468:7) error 20-Feb-2018 09:28:19 at Object.processArguments (E:\bamboo\remoteagent\xml-data\build-dir\UXATEC-CSDR-JOB1\node_modules\npm-cli-login\lib\login.js:34:56) error 20-Feb-2018 09:28:19 at module.exports (E:\bamboo\remoteagent\xml-data\build-dir\UXATEC-CSDR-JOB1\node_modules\npm-cli-login\lib\index.js:4:25) error 20-Feb-2018 09:28:19 at login (E:\bamboo\remoteagent\xml-data\build-dir\UXATEC-CSDR-JOB1\node_modules\npm-cli-login\bin\npm-cli-login.js:30:19) error 20-Feb-2018 09:28:19 at Object. (E:\bamboo\remoteagent\xml-data\build-dir\UXATEC-CSDR-JOB1\node_modules\npm-cli-login\bin\npm-cli-login.js:33:1) error 20-Feb-2018 09:28:19 at Module._compile (module.js:570:32) error 20-Feb-2018 09:28:19 at Object.Module._extensions..js (module.js:579:10) error 20-Feb-2018 09:28:19 at Module.load (module.js:487:32) error 20-Feb-2018 09:28:19 at tryModuleLoad (module.js:446:12)

When setting the path to --config-path "./.npmrc" trying to connect to the repository behind a proxy fails with

error 21-Feb-2018 16:37:38 info attempt registry request try #1 at 4:37:38 PM error 21-Feb-2018 16:37:38 http request PUT https://**********com/repository/npm-all/-/user/org.couchdb.user:******as error 21-Feb-2018 16:37:40 info retry will retry, error on last attempt: Error: connect ECONNREFUSED ...:443

webmutation avatar Feb 21 '18 16:02 webmutation

I have the same problem

Berezhnyk avatar May 15 '18 13:05 Berezhnyk

I have this problem as well.

yammerade avatar Jun 11 '18 18:06 yammerade

I have this problem too. I thought that npm was modern and supported. This is not true? It has bugs? A simple command like this is unsupported and bug reports are ignored?! This is unexpected and not entirely pleasing. No one in the npm community cares? Wow.

David263 avatar Aug 13 '18 13:08 David263

As a workaround, you can do

if (!process.env.HOME) {
  process.env.HOME = require('os').homedir();
}

before calling

require('npm-cli-login')('name', 'password');

on Windows.

kittaakos avatar Sep 11 '18 11:09 kittaakos

@kittaakos this works for me, thanks

yammerade avatar Sep 17 '18 17:09 yammerade

Can we have a fix implemented for this, still not fixed and annoying to use.

rmccarthy-ellevation avatar Jul 28 '21 16:07 rmccarthy-ellevation