gpt4 book ai didi

node.js - 第一次使用 gulp 用户,无法构建骨架项目。我在网络上没有看到任何其他内容出现此错误

转载 作者:太空宇宙 更新时间:2023-11-04 00:43:10 24 4
gpt4 key购买 nike

嗨,这是我第一次使用 gulp,我正在尝试使用 typescript/gulp/express 来形成 RESTful Web 服务。

我为此找到了一个框架项目,但当我尝试构建它时出现错误。

这是该项目的链接: https://github.com/idanov/express-ts-rest

Kevins-Mac-Pro:express-ts-rest kevincmanning$ gulp buildAll
{ file: undefined,
start: undefined,
length: undefined,
messageText: 'Failed to parse file \'src/tsconfig.json\': text.charCodeAt is not a function.',
category: 1,
code: 5014 }
{ file: undefined,
start: undefined,
length: undefined,
messageText: 'Failed to parse file \'tests/tsconfig.json\': text.charCodeAt is not a function.',
category: 1,
code: 5014 }
[00:59:23] Using gulpfile ~/Projects/express-ts-rest/gulpfile.js
[00:59:23] Starting 'build'...
[00:59:23] 'build' errored after 10 ms
[00:59:23] TypeError: Cannot read property 'on' of null
at DestroyableTransform.Readable.pipe (/Users/kevincmanning/Projects/express-ts-rest/node_modules/vinyl-fs/node_modules/readable-stream/lib/_stream_readable.js:516:7)
at Gulp.<anonymous> (/Users/kevincmanning/Projects/express-ts-rest/gulpfile.js:35:10)
at module.exports (/Users/kevincmanning/Projects/express-ts-rest/node_modules/orchestrator/lib/runTask.js:34:7)
at Gulp.Orchestrator._runTask (/Users/kevincmanning/Projects/express-ts-rest/node_modules/orchestrator/index.js:273:3)
at Gulp.Orchestrator._runStep (/Users/kevincmanning/Projects/express-ts-rest/node_modules/orchestrator/index.js:214:10)
at Gulp.Orchestrator.start (/Users/kevincmanning/Projects/express-ts-rest/node_modules/orchestrator/index.js:134:8)
at /usr/local/lib/node_modules/gulp-cli/lib/versioned/^3.7.0/index.js:46:20
at nextTickCallbackWith0Args (node.js:415:9)
at process._tickCallback (node.js:344:13)
at Function.Module.runMain (module.js:443:11)

最佳答案

该项目在Ubuntu下运行良好。但是,OS X 的 gulp-tsb 包存在问题,导致您出现问题。您可以通过https://github.com/jrieken/gulp-tsb/issues/34跟进进度

同时,如果您想绕过它,只需在第 11 行编辑 node_modules/gulp-tsb/lib/index.js ,替换 fs_1.readFileSync(path, undefined);fs_1.readFileSync(path, 'utf-8');

关于node.js - 第一次使用 gulp 用户,无法构建骨架项目。我在网络上没有看到任何其他内容出现此错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35884144/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com