我的npm安装了this模块,它显示在我的package.json的依赖项中。当我执行import { clusterData } from 'hclust'时,VS代码告诉我Could not find a declaration file for module 'hclust'. '/Users/danielsteman/Desktop/dev/spotify_cluster_analysis/webapp/reactTensor/node_modules/hclust/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/hclust if it exists or add a new declaration (.d.ts) file containing declare module 'hclust';ts(7016)。我也试图运行npm i --save-dev @types/hclust,但是我得到了一个404not found的错误。我不知道如何解决这个问题。
发布于 2021-03-01 04:29:36
由于@types/hclust不存在,您需要为hclust模块创建自己的.d.ts声明文件。
当您这样做时,您也可以选择将其提交给DefinitelyTyped,以便其他人可以从中受益。
https://stackoverflow.com/questions/66259662
复制相似问题