Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 发布NPM模块时如何管理外部.d.ts依赖关系?_Node.js_Typescript_Npm_Typescript Typings - Fatal编程技术网

Node.js 发布NPM模块时如何管理外部.d.ts依赖关系?

Node.js 发布NPM模块时如何管理外部.d.ts依赖关系?,node.js,typescript,npm,typescript-typings,Node.js,Typescript,Npm,Typescript Typings,我正在将模块发布到NPM注册表 它是用TypeScript构建的(使用package.json中的typings属性和我的tsconfig.json中的声明:true) error TS2654: Exported external package typings file cannot contain tripleslash references. 在构建NPM模块时,我需要以下.d.ts文件,这些文件是通过打字工具下载的: ES6承诺 MQTT.js 当我生成模块并将其

我正在将模块发布到NPM注册表

它是用TypeScript构建的(使用
package.json中的
typings
属性和我的
tsconfig.json中的
声明:true

error TS2654:
    Exported external package typings file cannot contain
    tripleslash references.
在构建NPM模块时,我需要以下
.d.ts
文件,这些文件是通过
打字工具下载的:

  • ES6承诺
  • MQTT.js
当我生成模块并将其包含在子项目中时,TypeScript警告我不要在模块中使用三重斜杠引用。这些引用是由TypeScript在我将
声明:true
添加到我的
tsconfig.json
时添加的

error TS2654:
    Exported external package typings file cannot contain
    tripleslash references.
如果删除引用,则会出现类型错误(或重复标识符警告)

发布具有子依赖项的NPM模块的正确方法是什么

发布具有子依赖项的NPM模块的正确方法是什么

目前情况正在发生变化。纯ts包依赖于纯ts包的情况非常清楚(更多:)

但是,如果您的包依赖于
.js
项目的其他.d.ts文件,那么我建议您只向用户提及独立下载那些
.js
项目的定义

更多 即将推出的内容:
.d.ts
针对
.js
项目的NPM包。这是一个不断变化的过程,这个领域的情况正在迅速变化