npm-cli-login generates an error message


(David Spector) #1

I am a beginner! I installed npm on Windows and followed the instructions on page https://www.npmjs.com/package/npm-cli-login to run “npm-cli-login” but it does not work. Instead, I get the following error message, which I do not understand:

path.js:28
throw new TypeError('Path must be a string. Received ’ + inspect(path));
^

TypeError: Path must be a string. Received undefined
at assertPath (path.js:28:11)
at Object.join (path.js:489:7)
at Object.processArguments (C:\Users\david\AppData\Roaming\npm\node_modules\npm-cli-login\lib\login.js:34:56)
at module.exports (C:\Users\david\AppData\Roaming\npm\node_modules\npm-cli-login\lib\index.js:4:25)
at login (C:\Users\david\AppData\Roaming\npm\node_modules\npm-cli-login\bin\npm-cli-login.js:30:19)
at Object. (C:\Users\david\AppData\Roaming\npm\node_modules\npm-cli-login\bin\npm-cli-login.js:33:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions…js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)

Running in command prompt window with Admin access.
Env variables set up.
New HP laptop, Windows 10 Home, nodejs version v8.11.3, npm version 5.6.0


(Markus Tacker) #2

This has been reported as an issue here: https://github.com/postmanlabs/npm-cli-login/issues/22

If you are looking for the official way to handle authentication, check out https://docs.npmjs.com/private-modules/ci-server-config

Typcially, on a fresh machine you would start with npm login though.


(David Spector) #3

Markus, thanks for that. You say “on a fresh machine”. Are you implying that npm need only be logged into once? This confuses me, since most websites must be logged in each time you browse to them after some time has passed. Remember, I’m a beginner.


(Markus Tacker) #4

After having logged in, your credentials are stored in a .npmrc in your home folder, which will be used for all subsequent calls by npm which require authentication.


(David Spector) #5

I think that is a great design! Thanks.


(system) #6

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.