babel +路径+节点6.x:TypeError:路径必须为字符串.收到未定义 [英] babel + path + node 6.x: TypeError: Path must be a string. Received undefined
本文介绍了babel +路径+节点6.x:TypeError:路径必须为字符串.收到未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我一直试图将自己的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"
我完全不知道从哪里开始调试.有人有建议吗? :)更多信息将是相关的?让我知道!
提前谢谢!
解决方案
将babel-core升级到6.10.4 ..
I've been trying to update my nodejs version to 6.x but the following errors always appear everytime:
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
I tried with those three version:
- nodejs-6.0.0-1
- nodejs-6.2.0-1
- nodejs-6.2.1-1
in package.json
:
"babel-core": "^6.9.1"
I quite lost about where to start looking to debug. Anybody has a suggestion ? :) More info would be relevent ? Let me know !
Thanks in advance !
解决方案
upgrade babel-core to 6.10.4..
这篇关于babel +路径+节点6.x:TypeError:路径必须为字符串.收到未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文