Node.js 错误:没有为节点googlemaps定义GoogleMapsAPI

Node.js 错误:没有为节点googlemaps定义GoogleMapsAPI,node.js,google-maps-api-3,google-api,npm,sails.js,Node.js,Google Maps Api 3,Google Api,Npm,Sails.js,我正在使用Node js查询googlemapsapi。我作为一名开发人员创建了我的服务器API密钥。根据文档,我必须使用API键和某些其他参数创建一个publicConfig变量。我的publicConfig变量如下所示: var gm = require('googlemaps'); var publicConfig = { key: 'myKey', stagger_time:1000, // for elevationPath encode_polylines:false

我正在使用Node js查询
googlemapsapi
。我作为一名开发人员创建了我的服务器API密钥。根据文档,我必须使用API键和某些其他参数创建一个
publicConfig
变量。我的publicConfig变量如下所示:

 var gm = require('googlemaps');
 var publicConfig = {
  key: 'myKey',
  stagger_time:1000, // for elevationPath
  encode_polylines:false,
  secure:true // use https
};
 var gmAPI = new GoogleMapsAPI(publicConfig);
当我运行代码时,我得到以下错误

 ReferenceError: GoogleMapsAPI is not defined

有人能帮我解决这个问题吗?

要解决这个问题,我必须包含以下代码行

var GoogleMapsAPI = require('googlemaps');

你把图书馆包括进去了吗?你确定有空吗?