【问题标题】:How to install @types from an NPM package that has @ in it's name如何从名称中包含 @ 的 NPM 包中安装 @types
【发布时间】:2019-10-30 14:24:27
【问题描述】:

我可以安装这个节点包

npm install @gamestdio/timer --save

但是,当我尝试安装与之配套的类型时

npm install @types/@gamestdio/timer --save

结果是

Invalid package name "@types/": name can only contain URL-friendly characters

【问题讨论】:

  • 如果我没记错的话,试试@types/__gamestdio/timer
  • 这对我不起作用,但我会继续四处寻找

标签: node.js typescript npm


【解决方案1】:

你可以使用纱线

yarn add @types/@gamestdio/timer

或手动添加到您的package.json

  "dependencies": {
    "@types/": "gamestdio/timer",
  }

然后删除您的 node_modules 文件夹并再次运行 npm install

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-10-01
    • 2015-07-09
    • 1970-01-01
    • 1970-01-01
    • 2017-09-15
    • 2020-01-01
    • 2021-04-13
    • 1970-01-01
    相关资源
    最近更新 更多