gulp打字稿时的TypeError
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了gulp打字稿时的TypeError相关的知识,希望对你有一定的参考价值。
我执行我的Typescript转换时遇到以下错误:
TypeError: file.isSymbolic is not a function
at DestroyableTransform.normalize [as _transform] (D:project
ode_modulesvinyl-fslibdestprepare.js:31:15)
at DestroyableTransform.Transform._read (D:project
ode_modulesvinyl-fs
ode_modules
eadable-streamlib\_stream_transform.js:182:10)
at DestroyableTransform.Transform._write (D:project
ode_modulesvinyl-fs
ode_modules
eadable-streamlib\_stream_transform.js:170:83)
at doWrite (D:project
ode_modulesvinyl-fs
ode_modules
eadable-streamlib\_stream_writable.js:406:64)
at writeOrBuffer (D:project
ode_modulesvinyl-fs
ode_modules
eadable-streamlib\_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (D:project
ode_modulesvinyl-fs
ode_modules
eadable-streamlib\_stream_writable.js:322:11)
at Pumpify.Duplexify._write (D:project
ode_modulespumpify
ode_modulesduplexifyindex.js:201:22)
at doWrite (D:project
ode_modulespumpify
ode_modules
eadable-streamlib\_stream_writable.js:406:64)
at writeOrBuffer (D:project
ode_modulespumpify
ode_modules
eadable-streamlib\_stream_writable.js:395:5)
at Pumpify.Writable.write (D:project
ode_modulespumpify
ode_modules
eadable-streamlib\_stream_writable.js:322:11)
我的gulp任务看起来像这样:
gulp.task('tsc', function () {
let tsResult = gulp.src(srcPaths.tsFiles)
.pipe(tsProject()); // tsProject created previously
return tsResult.js
.pipe(gulp.dest(buildPath)); // -> the gulp.dest(..) command causes the error
});
package.json devDependencies(只有gulp和ts相关的依赖项)如下所示:
{
"devDependencies": {
"gulp": "github:gulpjs/gulp#4.0",
"gulp-sourcemaps": "^2.6.1",
"gulp-tslint": "^8.1.2",
"gulp-typescript": "^3.2.3",
"tslint": "^5.8.0",
"typescript": "^2.5.0",
}
}
节点版本:8.9.3和npm版本:5.6.0
任何人都知道该怎么做?
答案
从gulp repo(issue):
phated在5小时前评论过
您的插件需要更新才能使用更新的乙烯基。他们用来创建文件对象的那个真的很旧。
来自同一问题的另一个解决方案(它适用于我):
dozer75 4小时前评论过•编辑过
...您可以在#之后引用先前的提交ID而不是分支名称。最后一个是6d71a65
以上是关于gulp打字稿时的TypeError的主要内容,如果未能解决你的问题,请参考以下文章
编译打字稿时如何防止错误“对象类型的索引签名隐式具有'任何'类型”?