npm publish / npm install - auth token invalidation

时间:2021-03-08 16:55:42

I think NPM is struggling with security a bit today, when I run npm install on a local project, I get:

我认为NPM今天有点安全性,当我在本地项目上运行npm install时,我得到:

'npm WARN notice Due to a recent security incident, all user tokens have been invalidated. Please see https://status.npmjs.org/incidents/dn7c1fgrr7ng for more details. To generate a new token, visit https://www.npmjs.com/settings/~/tokens or run "npm login"

'npm WARN notice通知由于最近发生的安全事件,所有用户令牌都已失效。有关更多详细信息,请参阅https://status.npmjs.org/incidents/dn7c1fgrr7ng。要生成新令牌,请访问https://www.npmjs.com/settings/~/tokens或运行“npm login”

I signed in again with npm login, but I get the same error. Does anyone know of a workaround?

我用npm登录再次登录,但是我得到了同样的错误。有没有人知道一个解决方法?

4 个解决方案

#1


8  

I get same warning even after the new login:

即使在新登录后我也会收到相同的警告:

npm publish / npm install  -  auth token invalidation

I get that if the package name is incorrect, on top of the 404 error.

如果包名称不正确,我会得到,除了404错误。

If you need to be logged in just log back in.

如果您需要登录,请重新登录。

If you don't need to be logged in just check that you have the correct package name.

如果您不需要登录,只需检查您是否具有正确的包名称。

In my case react-native-create-app didn't exist.. After adding the correct name: create-react-native-app it worked.

在我的情况下,react-native-create-app不存在。添加正确的名称后:create-react-native-app它有效。

#2


3  

Make sure you have your npmrc file set up ok. https://docs.npmjs.com/files/npmrc

确保你的npmrc文件设置正常。 https://docs.npmjs.com/files/npmrc

#3


3  

Steps to follow:

要遵循的步骤:

  1. Run npm login
  2. 运行npm登录
  3. Enter your

    输入您的

    1. Username
    2. 用户名
    3. Password
    4. 密码
    5. Email address
    6. 电子邮件地址

    Note: if you don't have this credentials, you have to sign up at https://www.npmjs.com/signup

    注意:如果您没有此凭据,则必须在https://www.npmjs.com/signup上注册

  4. Run npm install bootstrap --save

    运行npm install bootstrap --save

This should work.

这应该工作。

#4


2  

After performing npm login try to reopen CLI you are using in order to run npm commands. It worked for me

执行npm登录后尝试重新打开您正在使用的CLI以运行npm命令。它对我有用

#1


8  

I get same warning even after the new login:

即使在新登录后我也会收到相同的警告:

npm publish / npm install  -  auth token invalidation

I get that if the package name is incorrect, on top of the 404 error.

如果包名称不正确,我会得到,除了404错误。

If you need to be logged in just log back in.

如果您需要登录,请重新登录。

If you don't need to be logged in just check that you have the correct package name.

如果您不需要登录,只需检查您是否具有正确的包名称。

In my case react-native-create-app didn't exist.. After adding the correct name: create-react-native-app it worked.

在我的情况下,react-native-create-app不存在。添加正确的名称后:create-react-native-app它有效。

#2


3  

Make sure you have your npmrc file set up ok. https://docs.npmjs.com/files/npmrc

确保你的npmrc文件设置正常。 https://docs.npmjs.com/files/npmrc

#3


3  

Steps to follow:

要遵循的步骤:

  1. Run npm login
  2. 运行npm登录
  3. Enter your

    输入您的

    1. Username
    2. 用户名
    3. Password
    4. 密码
    5. Email address
    6. 电子邮件地址

    Note: if you don't have this credentials, you have to sign up at https://www.npmjs.com/signup

    注意:如果您没有此凭据,则必须在https://www.npmjs.com/signup上注册

  4. Run npm install bootstrap --save

    运行npm install bootstrap --save

This should work.

这应该工作。

#4


2  

After performing npm login try to reopen CLI you are using in order to run npm commands. It worked for me

执行npm登录后尝试重新打开您正在使用的CLI以运行npm命令。它对我有用