Axios 版本 package.json

Axios version package.json

我想切换到 axios 0.12 版本。是否可以从最新版本返回?

"axios": {
      "version": "0.16.2",
      "resolved": "https://registry.npmjs.org/axios/-/axios-0.16.2.tgz",
      "integrity": "sha1-uk+S8XFn37q0CYN4VFS5rBScPG0=",
      "requires": {
        "follow-redirects": "1.2.4",
        "is-buffer": "1.1.5"
      }
    },

是的,这是可能的。通用形式如下:

npm install <package>@<version>

例如:npm install foobar@2.0.0

您还可以将 --save 标志添加到该命令以将其添加到您的 package.json 依赖项,或者如果您想要在 [=29] 中指定的确切版本,则添加 --save --save-exact 标志=]依赖项。

如果您不确定可用的软件包版本,您可以使用:

npm view <package> versions

我会推荐你​​通过documentation of the npm install command

虽然与这个问题完全无关,但我还是建议你阅读一下 yarn and