【发布时间】:2019-02-22 13:21:54
【问题描述】:
所以我们遇到了一个问题,即通过 npm 在我们的构建机器上安装的文件与在我们开发人员的机器上本地使用的文件不同。
我们使用的是 TypeScript,所以需要为一些 npm 包安装 @types,所以在我们的 package.json 文件中,我们有...
"dependencies": {
"react-autosuggest": "^9.3.4"
}
"devDependencies": {
"@types/react-autosuggest": "^9.3.3"
}
在本地全新安装 npm 时,这是下拉类型文件,并在顶部的文件中显示;
// Type definitions for react-autosuggest 9.3
// Project: http://react-autosuggest.js.org/
// Definitions by: Nicolas Schmitt <https://github.com/nicolas-schmitt>
// Philip Ottesen <https://github.com/pjo256>
// Robert Essig <https://github.com/robessog>
// Terry Bayne <https://github.com/tbayne>
// Christopher Deutsch <https://github.com/cdeutsch>
// Kevin Ross <https://github.com/rosskevin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
但是,构建服务器上的版本是;
// Type definitions for react-autosuggest 9.3
// Project: http://react-autosuggest.js.org/
// Definitions by: Nicolas Schmitt <https://github.com/nicolas-schmitt>
// Philip Ottesen <https://github.com/pjo256>
// Robert Essig <https://github.com/robessog>
// Terry Bayne <https://github.com/tbayne>
// Christopher Deutsch <https://github.com/cdeutsch>
// Kevin Ross <https://github.com/rosskevin>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
注意 TypeScript 的版本差异。
因此,无论出于何种原因,文件类型似乎都是相同的 9.3,但有些地方不太对劲。在本地,我们现在看到不同的行为与发布到实时环境的内容。
有人有什么想法吗?
【问题讨论】:
标签: node.js typescript npm