executed
vsts-npm-auth -config .npmrc
and I'm getting
Could not find a part of the path 'H:\'.
I dont have drive H
@risogolo -- Richard, thank you for your feedback; we appreciate it. To make sure we have all the information needed to triage your issue, please let us know which topic you鈥檙e referencing, or provide more context around your general task.
I need to authenticate myself against Azure Azure Artifacts with npm, I'm following the instructions, I have done
@risogolo -- Richard, please clarify which docs.microsoft.com article you're looking at.
Not sure how this uri is built so, please go https://devops.azure.com/ then to your project, artifacts, connect to feed, npm, there you will see project setup
@risogolo -- Richard, thank you for that information. From your comment of Feb 16th, in which docs.microsoft.com article are you following the instructions?
Again, from here: Not sure how this uri is built so, please go https://devops.azure.com/ then to your project, artifacts, connect to feed, npm, there you will see project setup instructions
@risogolo -- Richard, thank you for clarifying. You may find answers here:
@chasewilson -- Chase, please look into this potential documentation issue.
Guys, honestly I think it is not a documentation issue, it is an issue of vsts-npm-auth, once I execute that vsts-npm-auth -config .npmrc I'm getting "Could not find a part of the path 'H:'." I dont have such drive and never had
I don't have much to add other than "me too". The instructions @risogolo is referencing are provided by Azure DevOps, and also repeated at https://docs.microsoft.com/en-us/azure/devops/artifacts/npm/npmrc?view=azure-devops&tabs=windows (the page that you linked to).
Both of those advise the developer to run vsts-npm-auth -c npmrc or similar, and that is what's producing the bogus error message. In my case:
$ vsts-npm-auth -c .npmrc
vsts-npm-auth v0.37.0.0
-----------------------
Could not find a part of the path 'G:\'.
As with @risogolo I do not have a G: drive. I get the same error message regardless if I use ./npmrc or .npmrc or /path/to/project/.npmrc - so either some path logic is broken, or the error message is misleading. Possibly related to https://github.com/MicrosoftDocs/vsts-docs/issues/5508.
Same here:
vsts-npm-auth v0.37.0.0
-----------------------
Ein Teil des Pfades "U:\" konnte nicht gefunden werden.
Also, no U-drive
Found this post: https://github.com/microsoft/azure-pipelines-tasks/issues/7938
So I fixed my HOMEDRIVE-variable to C and it worked :-)
I have the same issue. Seems also that I have the path set via group policy. Whatever I set for HOMEDRIVE or HOMEPATH is never used. It is always P:\ (which is some network drive) that it tries to look for the .npmrc file. Is there any workaround??
Output from my environment variables:
PS C:\_Work\Development\WebApp.Components> $env:HOMEDRIVE
P:
PS C:\_Work\Development\WebApp.Components> $env:HOMEPATH
\
PS C:\_Work\Development\WebApp.Components> $env:USERPROFILE
C:\Users\matsa
My HOMEDRIVE is set to H: because that is how our organization is set up and I also wanted git-scm bash shell to use it. So when I run vsts-npm-auth it updates H:\.npmrc and my Azure Artifacts token is updated, but not seen by my git repo in my IDE. I have to manually go update c:\users\some-user\.npmrc to get my token recognized. We just started working with Azure DevOps so this is going to be a pain for lots of people.
[...] so this is going to be a pain for lots of people.
Especially when they have no rights to change anything on that drive like it is the case for me. I can not use this at all and need to find a workaround how to actually publish something now...
This one had me thrown off for a while as well :-) Anyone figured out a workaround yet?
I used a build Pipeline that is connected with the feed. That has no problems publishing my package. Of course your scenario may vary. I still have that problem when I want to install new packages via npm install. Need to use a token inside the project .npmrc for that to work..
For anyone that might be helped by this: the tool is trying to locate your home directory using the $HOMEDRIVE environment variable to write the .npmrc to. You can get around this without modifying your environment by providing the .npmrc path with -T or -TargetConfig. For example, this will authorize me using the .npmrc from my current directory, but will write the credentials to my user directory at ~/.npmrc.
$ vsts-npm-auth -config .npmrc -TargetConfig ~/.npmrc
@risogolo Thank you for your feedback.
Guys, honestly I think it is not a documentation issue, it is an issue of vsts-npm-auth, once I execute that vsts-npm-auth -config .npmrc I'm getting "Could not find a part of the path 'H:'." I dont have such drive and never had
Just as an FYI for anyone in the future: this is not an issue with documentation. Changing HOMEDRIVE to your C drive should solve the issue.
Well, as was said already, changing the HOMEDRIVE variable might not be the solution for everybody since it might be prevented by group policy. As @maslade mentioned the location of the .npmrc file can be set via -t option. That at last worked for me. It might be worthwhile to add that to the docs just to help others.