I am receiving the following error across all typescript projects that I am trying run.
TS5042 Build: Option 'project' cannot be mixed with source files on a command line.
I have downloaded a free Typescript Angular2 template, ran it and this error immediately pops up.
Has it got something to do with my global typescript installation?
The tsc
command can be run in two ways:
project
parameter, which points to the directory that contains a tsconfig.json
. For example: tsc --project ./app
. The location of the tsconfig.json
determines the set of files that should be included in the compilation. See here for more about the tsconfig.json
: http://www.typescriptlang.org/docs/handbook/tsconfig-json.html tsc MyFile1.ts MyFile2.ts MyFile3.ts
.These two options are incompatible with each other because they both attempt to define which files should be compiled.
What is the command you are using to compile your project? Or are you using an IDE that runs the build for you?
Here's the reference for the tsc
compiler options.
i was getting same error but when removed every space in my folders name as shown in path from tsc compiler it now successfully builds.See also this GitHub issue.
I have found a fix that works for me. I have more than one version of Visualstudio at c:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\
Open v15.0 and copy the Typescript folder to the v14.0 folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With