第一次吞噬用户,不能build立骨架项目。 我没有看到这个错误在networking上的其他任何东西

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

我为此find了一个框架项目,但是当我尝试构build它时,出现错误。

这里是项目的链接: 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来跟进进&#x5EA6;

同时,如果你想破解它,只需要编辑第11行的node_modules/gulp-tsb/lib/index.js来replacefs_1.readFileSync(path, undefined);fs_1.readFileSync(path, 'utf-8');

运行任务的步骤:

  1. 首先下载该项目
  2. 导航到terminal中的项目文件夹,然后执行npm install
  3. 成功安装后,请执行npm install -g gulp这将在全局安装gulp。
  4. 运行一个吞咽任务。 例如,在项目文件夹的terminal上, gulp build执行称为build的gulp任务。