Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
angular2-无法动态传输ES模块,angular2谷歌地图自动完成_Angular - Fatal编程技术网

angular2-无法动态传输ES模块,angular2谷歌地图自动完成

angular2-无法动态传输ES模块,angular2谷歌地图自动完成,angular,Angular,我在做一个有棱角的项目。Iam使用angular2谷歌地图自动完成模块实现谷歌位置自动完成功能。 为此,我在Systemjs.config.js中包含了以下几行代码 var map ={ 'angular2-google-map-auto-complete' : 'node_modules/angular2-google-map-auto-complete'}; var packages = {'angular2-google-map-auto-c

我在做一个有棱角的项目。Iam使用angular2谷歌地图自动完成模块实现谷歌位置自动完成功能。 为此,我在Systemjs.config.js中包含了以下几行代码

            var map ={ 'angular2-google-map-auto-complete' : 'node_modules/angular2-google-map-auto-complete'};
            var packages = {'angular2-google-map-auto-complete' : {defaultExtension:'js'}};
但在启动npm服务器时,iam在控制台上出现以下错误

Error: Unable to dynamically transpile ES module
   A loader plugin needs to be configured via `SystemJS.config({ transpiler: 'transpiler-module' })`.
  Instantiating http://localhost:3000/node_modules/angular2-google-map-auto-complete/directives/googleplace.directive.js
  Loading http://localhost:3000/app/app.module.js
  Loading main.js
    at transpile (instantiate.js:463)
    at instantiate.js:241
    at ZoneDelegate.invoke (zone.js:365)
    at Zone.run (zone.js:125)
    at zone.js:760
    at ZoneDelegate.invokeTask (zone.js:398)
    at Zone.runTask (zone.js:165)
    at drainMicroTaskQueue (zone.js:593)
    at <anonymous>
错误:无法动态传输ES模块
加载程序插件需要通过'SystemJS.config({transpiler:'transpiler module'})配置。
实例化http://localhost:3000/node_modules/angular2-谷歌地图自动完成/directions/googleplace.directive.js
加载http://localhost:3000/app/app.module.js
加载main.js
在Transfile上(instantiate.js:463)
在instantiate.js:241
在ZoneDelegate.invoke(zone.js:365)
在Zone.run(Zone.js:125)
在zone.js:760
在ZoneDelegate.invokeTask(zone.js:398)
位于Zone.runTask(Zone.js:165)
在drainMicroTaskQueue(zone.js:593)
在

任何帮助都将不胜感激。

经过研究,我找到了解决方案。我刚刚安装了babel插件

npm i systemjs-plugin-babel 
然后更新了systemjs.config.js文件

SystemJS.config({
  map: {
    'plugin-babel': 'path/to/systemjs-plugin-babel/plugin-babel.js',
    'systemjs-babel-build': 'path/to/systemjs-plugin-babel/systemjs-babel-browser.js'
  },
  transpiler: 'plugin-babel'
});
重新启动npm及其工作