nodejs,When I execute NPM install, I need to execute NPM login, but I don't know where the account and password are, please help me

Chen Yong 陈勇 1 Reputation point
2022-09-27T09:57:20.747+00:00

When I execute NPM install, I need to execute NPM login, but I don't know where the account and password are, please help me!
The git url:https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/js/browser

The log:
PS E:\mygit\cognitive-services-speech-sdk\samples\js\browser> npm install
npm ERR! code E401
npm ERR! Unable to authenticate, your authentication token seems to be invalid.
npm ERR! To correct this please trying logging in again with:
npm ERR! npm login

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\50212\AppData\Local\npm-cache_logs\2022-09-27T08_58_16_414Z-debug-0.log
PS E:\mygit\cognitive-services-speech-sdk\samples\js\browser> npm login
npm WARN adduser adduser will be split into login and register in a future version. adduser will become an alias of register. login (currently an alias) will become its own command.
npm notice Log in on https://pkgs.dev.azure.com/msasg/skyman/_packaging/skyman_PublicPackages/npm/registry/
Username:

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,598 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. YutongTie-MSFT 53,966 Reputation points Moderator
    2022-09-27T23:02:24.933+00:00

    Hello @Chen Yong 陈勇

    Thanks for reaching out to us for this issue. This seems to be a popular issue of npm - sometimes you saved some credentials for private repo on .npmrc file at the root of the home folder. So when you did npm install on project, you migght get package-lock.json file contents appended with the private repo url. That may be the reason you had this issue.

    The solution worked for me before was temporarily remove the .npmrc, delete package-lock.json, delete node_modules and re-run npm install.

    Please have a try, I hope this helps.

    Regards,
    Yutong

    -Please kindly accept the answer if you feel helpful to support the community, thanks a lot.

    3 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.