当我尝试使用离子启动新应用程序时,msg.trim不是函数
这是错误:
TypeError:msg.trim不是Logger.log中的函数(/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/logger.js:78:21)在Logger.error (/usr/local/lib/node_modules/ionic/node_modules/@ionic/cli-utils/lib/utils/logger.js:35:14)。 (/usr/local/lib/node_modules/ionic/dist/index.js:186:22)在Generator.throw()被拒绝(/usr/local/lib/node_modules/ionic/node_modules/tslib/tslib.js: 101:69)at
这里是我正在运行的命令:
$ ionic启动myApp
我的node.js版本是v8.9.1 ,npm是5.5.1
这是我在logger.js文件中找到的
log(level, msg) {
if (this.shouldLog(level)) {
let prefix = this.prefix;
if (typeof msg === 'function') {
msg = msg();
}
if (prefix) {
if (typeof prefix === 'function') {
prefix = prefix();
}
msg = util.format(prefix, msg);
}
const color = this.getStatusColor(level);
const status = color.bold.bgBlack;
const b = chalk_1.default.dim;
const msgLines = format_1.wordWrap(msg, { indentation: level === 'info' ? 0 : level.length + 3 }).split('n');
if (msg.trim().includes('n')) {
msg = msgLines.map((l, i) => {
// We want these log messages to stand out a bit, so automatically
// color the first line and separate the first line from the other
// lines if the message is multi-lined.
if (i === 0 && this.firstLineColored.includes(level)) {
return color(l) + (msgLines.length > 1 ? 'n' : '');
}
return l;
}).join('n') + 'nn';
}
else {
msg = msgLines.join('n');
}
msg = this.enforceLF(msg);
const fmtLevel = () => b('[') + status(level.toUpperCase()) + b(']');
if (level !== 'info') {
msg = `${fmtLevel()} ${msg}`;
}
this.stream.write(util.format(msg));
}
链接地址: http://www.djcxy.com/p/33019.html
上一篇: I am getting msg.trim is not a function when trying to start new app with ionic
下一篇: Using gulp with babelify + browserify cannot find module