admin管理员组文章数量:814879
得到错误:找不到模块'mg
当我尝试导入模块时,我遇到错误Could not find a declaration file for module 'mg-api-js'
,我试图以这种方式安装它npm install @types/mg-api-js
,但它也无法正常工作,任何人都可以帮助我解决此问题吗?
const GeotabApi = require('mg-api-js');
const authentication = {
credentials: {
database: '**',
userName: '****',
password: '****'
}
}
const api = new GeotabApi(authentication);
回答如下:1)删除您的node_modules目录,然后:npm install --save mg-api-js
。
2)检查您的node_modules/mg-api-js/dist
目录并确保api.min.js
存在。
3)如果不存在,则可以从https://github/Geotab/mg-api-js复制源代码并手动粘贴到此node_modules/mg-api-js
目录中。
4)请安装最新版本'2.0.1'
5)看到此问题,可能会对您有所帮助:https://github/Geotab/mg-api-js/issues/3
我将这个模块安装在Windows上并为我工作。
本文标签: 得到错误找不到模块39mg
版权声明:本文标题:得到错误:找不到模块'mg 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/biancheng/1715134158a821415.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论