babel +path+节点6.x:TypeError:path必须是string。 收到undefined

我一直在尝试将我的nodejs版本更新到6.x,但每次都会出现以下错误:

path.js:7 throw new TypeError('Path must be a string. Received ' + inspect(path)); ^ TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.dirname (path.js:1326:5) at /usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:374:36 at /usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:396:22 at Array.map (native) at OptionManager.resolvePresets (/usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:385:20) at OptionManager.mergePresets (/usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:369:10) at OptionManager.mergeOptions (/usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328:14) at /usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:370:14 at /usr/lib/node_modules/babel-core/lib/transformation/file/options/option-manager.js:390:24 

我尝试了这三个版本:

  • 的NodeJS-6.0.0-1
  • 的NodeJS-6.2.0-1
  • 的NodeJS-6.2.1-1

package.json"babel-core": "^6.9.1"

我很失去从哪里开始寻找debugging。 任何人有一个build议? :)更多信息将是相关的? 让我知道 !

提前致谢 !

这个问题与Node 6有关。使用Node 5.x可能会解决这个问题,如果这是一个选项。

最简单的方法是安装节点版本pipe理器 ( 或Windows的一个端口 ),然后运行这些命令:

 nvm install 5 nvm use 5 

如果要将5.x用作默认节点版本,请运行以下命令:

 nvm alias default 5 

将babel-core升级到6.10.4 ..