简体   繁体   中英

NPM: Getting 403 whoami with npm-automation-token

I'm getting 403 for the command npm whoami when I'm using annpm-automation-token This my npmrc:

//registry.npmjs.org/:_authToken=${NPM_TOKEN}

When I run the following command:

NPM_TOKEN=xxxxxx-xxxxx-xxxxxx-xxxxx-xxxxx npm whoami

npm ERR! code E403 npm ERR! 403 403 Forbidden - GET https://registry.npmjs.org/-/whoami npm ERR! 403 In most cases, you or one of your dependencies are requesting npm ERR! 403 a package version that is forbidden by your security policy.

Apparently npm token for automation doesn't support npm whoami see this issue .

For the time being you can generate a token for publish instead. I hope this helps future readers.

Edit (23 November 2020):

The whoami api is now working with Automation token.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM