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 ..
- 找不到模块:错误:无法parsing模块的“组件/应用程序”。 webpack + reactjs问题
- 如何使用babel与npm包将被反应使用
- 如何debugging在es6 / es7中编写的node.js后端?
- 您应该通过在Babelconfiguration中使用`env`部分禁用生产中的react-transform-hmr
- 运行babel时,JSdoc for方法在传输代码中丢失
- 导入react-native-fetch-blob时意外的令牌
- 我可以导入babel-polyfill模块而不是全部?
- 如何在Heroku上启用ES2017function来运行Node.js应用程序?
- 我还需要使用NodeJs5的babel吗?