Cannot read file 'tsconfig.json': readFile is not a function
iby opened this issue · comments
Everything works well with tsc
command, but when trying to build with tsproject getting this weird issue. Any ideas what this is about?
[TsProject] Building Project with: tsconfig.json
[TsProject] error TS5012: Cannot read file 'tsconfig.json': readFile is not a function
[TsProject] Build completed with errors.
@ianbytchek With Typescript 1.7.x this error message occurs when attempting to read the config file, tsconfig.json, ( in readConfigFile() Typescript API method ). The error message "readFile is not a function" indicates that the readFile() function passed to the API method is somehow not right.
It is most likely that you have installed an TsProject 1.2.0-rcX version. I haven't run into any issues with the latest RC version, so I would ask you to first update to TsProject 1.2.0-rc.4.
Please let me know what TsProject version you have installed ( you can find the information in the package.json file in node_modules/TsProject )
Hey Todd, thanks for heads up. Yes, I had 1.0.5 installed using "tsproject": "*"
, that's probably because there are no higher versions, only rcs.
Just in case someone views this issue: TsProject 1.05 is not compatible with Typescript 1.7.x. There was a breaking change in the readConfigFile() API method.
This still does not work with Typescript 2.3.x
See below:-
D:\js\bundling\rollup_ng2_tes1\test1>npm install tsproject --save-dev
test1@0.0.0 D:\js\bundling\rollup_ng2_tes1\test1
`-- tsproject@2.1.2
+-- @types/chalk@0.4.31
+-- @types/chokidar@1.6.0
+-- @types/glob@5.0.30
| `-- @types/minimatch@2.0.29
+-- @types/lodash@4.14.63
+-- @types/node@7.0.14
+-- @types/vinyl@1.2.30
+-- typescript@2.3.4
`-- vinyl@2.0.2
+-- clone-buffer@1.0.0
+-- clone-stats@1.0.0
+-- cloneable-readable@1.0.0
| `-- through2@2.0.3
`-- replace-ext@1.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64
"})
D:\js\bundling\rollup_ng2_tes1\test1>D:\js\bundling\rollup_ng2_tes1\test1\node_modules\.bin\rollup -c
? typescript.readConfigFile is not a function
D:\js\bundling\rollup_ng2_tes1\test1>tsc -v
Version 2.3.2
D:\js\bundling\rollup_ng2_tes1\test1>