最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

得到错误:找不到模块'mg

IT培训 admin 12浏览 0评论

得到错误:找不到模块'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上并为我工作。

得到错误:找不到模块'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上并为我工作。

与本文相关的文章

发布评论

评论列表 (0)

  1. 暂无评论