【问题标题】:npm WARN when creating files from create-react-app从 create-react-app 创建文件时的 npm WARN
【发布时间】:2020-08-04 12:53:11
【问题描述】:
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

up to date in 7.486s

65 packages are looking for funding
  run `npm fund` for details

fixed 0 of 1 vulnerability in 1649 scanned packages
  1 vulnerability required manual review and could not be updated
pc react_crash_todo % npm audit fix
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

up to date in 7.766s

65 packages are looking for funding
  run `npm fund` for details

fixed 0 of 1 vulnerability in 1649 scanned packages
  1 vulnerability required manual review and could not be updated
pc react_crash_todo % 

我正在尝试开始学习 react,但在使用 create-react-app 应用程序创建文件时出现此错误。我也注意到由于 tsutils 和 typescript 未安装而发生错误我尝试使用以下命令安装相同

sudo npm install -g tsutils sudo npm install -g typescript

它显示它也被安装了

+ tsutils@3.17.1
added 2 packages from 2 contributors in 0.225s

+ typescript@3.9.7
added 1 package from 1 contributor in 3.226s

但我仍然收到警告,知道如何解决这个问题。

提前致谢!

【问题讨论】:

  • 您可以放心地忽略这些警告。这只是js开发的正常部分

标签: node.js typescript npm


【解决方案1】:

这是一个node_modules 包警告,您可以放心地忽略该警告。

npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0

表示tsutils@3.17.1 不使用typescript@>=2.8.0。如果tsutils 的包仍然可以正常运行没有任何问题,那也没关系。要解决此问题,您应该在 node_modules 上更新 tsutils 而不是您的全球项目。维护者会在某个时候做并让警告消失是可以的。很合适。

【讨论】:

    猜你喜欢
    • 2019-08-03
    • 1970-01-01
    • 2021-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-06
    • 1970-01-01
    相关资源
    最近更新 更多