2015-12-16 25 views
1

我面對我的現有代碼停止工作的問題,我不能得到什麼對於此問題的原因,我有很簡單的程序,transpiles ES6代碼:類型錯誤:該插件「變換ES2015模塊,CommonJS的」沒有導出插件實例

TypeError: The plugin "transform-es2015-modules-commonjs" didn't export a Plugin instance 
    at PluginManager.validate (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\node_modules\babel-core\lib\transformation\file\plugin-manager.js:164:13) 
    at PluginManager.add (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\node_modules\babel-core\lib\transformation\file\plugin-manager.js:213:10) 
    at File.buildTransformers (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\node_modules\babel-core\lib\transformation\file\index.js:237:21) 
    at new File (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\node_modules\babel-core\lib\transformation\file\index.js:139:10) 
    at Pipeline.transform (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\node_modules\babel-core\lib\transformation\pipeline.js:164:16) 
    at load (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\Es6\index.js:63:26) 
    at Object.jsdom.env.done (C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\Es6\index.js:216:5) 
    at C:\Epam\dhl-ewf\cq\dhl-view\src\main\content\jcr_root\etc\clientlibs\dhl\global\Es6\node_modules\jsdom\lib\jsdom.js:271:18 
    at nextTickCallbackWith0Args (node.js:433:9) 
    at process._tickCallback (node.js:362:13) 

我的代碼是不是代表它停靠在下面一行:

let transpiled = babel.transform(source, { 
     "plugins": [ 
      'transform-es2015-modules-commonjs', 
      'transform-es2015-destructuring', 
      'transform-es2015-parameters', 
      'transform-es2015-spread' 
     ] }); 

可能是什麼問題?先謝謝你!

回答

4

您正在嘗試與Babel 5一起使用Babel 6插件。

+0

非常感謝! – Lu4

相關問題