手动安装节点依赖
installing node dependencies manually
正如我从 SO 主题中了解到的那样,自 npm 版本 3 以来,节点的依赖项不会自动即时安装。我是 运行 版本 3.5.2,当 运行 npm install --no-optional
:
npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/eslint-plugin@2.x but none was installed.
npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/parser@2.x but none was installed.
npm WARN eslint-config-react-app@5.0.2 requires a peer of eslint@6.x but none was installed.
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none was installed.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev
npm ERR! Missing: react-router-dom@^5.1.2
npm ERR! Invalid: lock file's @typescript-eslint/eslint-plugin@1.13.0 does not satisfy @typescript-eslint/eslint-plugin@2.8.0
npm ERR!
如何手动安装这些?
我试过了:
npm install @typescript-eslint/eslint-plugin@2.*
npm install eslint@6.*
npm install typescript@*
但这没有用。仍然会抛出这些警告。
我更进一步了:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @typescript-eslint/eslint-plugin@^5.16.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'client'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mark/.npm/_logs/2019-10-04T20_26_24_111Z-debug.log
请为每个对等依赖项使用以下内容来安装它并删除错误。
$ npm install --save-dev @typescript-eslint
另一个错误,
No matching version found for @typescript-eslint/eslint-plugin@^5.16.0.
请运行npm view @typescript-eslint/eslint-plugin
。
然后,你可以看到@typescript-eslint/eslint-plugin的最高版本现在是2.3.2。此 @typescript-eslint/eslint-plugin@^5.16.0
版本不存在。
正如我从 SO 主题中了解到的那样,自 npm 版本 3 以来,节点的依赖项不会自动即时安装。我是 运行 版本 3.5.2,当 运行 npm install --no-optional
:
npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/eslint-plugin@2.x but none was installed.
npm WARN eslint-config-react-app@5.0.2 requires a peer of @typescript-eslint/parser@2.x but none was installed.
npm WARN eslint-config-react-app@5.0.2 requires a peer of eslint@6.x but none was installed.
npm WARN ts-pnp@1.1.2 requires a peer of typescript@* but none was installed.
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev
npm ERR! Missing: react-router-dom@^5.1.2
npm ERR! Invalid: lock file's @typescript-eslint/eslint-plugin@1.13.0 does not satisfy @typescript-eslint/eslint-plugin@2.8.0
npm ERR!
如何手动安装这些?
我试过了:
npm install @typescript-eslint/eslint-plugin@2.*
npm install eslint@6.*
npm install typescript@*
但这没有用。仍然会抛出这些警告。
我更进一步了:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @typescript-eslint/eslint-plugin@^5.16.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'client'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mark/.npm/_logs/2019-10-04T20_26_24_111Z-debug.log
请为每个对等依赖项使用以下内容来安装它并删除错误。
$ npm install --save-dev @typescript-eslint
另一个错误,
No matching version found for @typescript-eslint/eslint-plugin@^5.16.0.
请运行npm view @typescript-eslint/eslint-plugin
。
然后,你可以看到@typescript-eslint/eslint-plugin的最高版本现在是2.3.2。此 @typescript-eslint/eslint-plugin@^5.16.0
版本不存在。