Error TS5042: Option 'project' cannot be mixed with source files on a command line when running npm run scully

See original GitHub issue

🐞 Bug report

The following error happens when I try running npm run scully:

using plugins from folder “./scully” Typescript error while compiling plugins. the error is: error TS5042: Option ‘project’ cannot be mixed with source files on a command line.

⠹ undefined npm ERR! code ELIFECYCLE npm ERR! errno 15 npm ERR! <project-name>@0.0.0 scully: scully npm ERR! Exit status 15 npm ERR! npm ERR! Failed at the <project-name>@0.0.0 scully script.

Create a new basic anular app, with one route to a test page and ran: ng add @scullyio/init npm run build npm run scully

Windows 10

Angular 10.2.0 Node: 12.18.3

Scully: 1.0.0

package.json: { “name”: “get-hydroponics-online”, “version”: “0.0.0”, “scripts”: { “ng”: “ng”, “start”: “ng serve”, “build”: “ng build”, “test”: “ng test”, “lint”: “ng lint”, “e2e”: “ng e2e”, “scully”: “scully”, “scully:serve”: “scully serve” }, “private”: true, “dependencies”: { “@angular/animations”: “~10.2.0”, “@angular/common”: “~10.2.0”, “@angular/compiler”: “~10.2.0”, “@angular/core”: “~10.2.0”, “@angular/forms”: “~10.2.0”, “@angular/platform-browser”: “~10.2.0”, “@angular/platform-browser-dynamic”: “~10.2.0”, “@angular/router”: “~10.2.0”, “@scullyio/init”: “^1.0.1”, “@scullyio/ng-lib”: “^1.0.0”, “@scullyio/scully”: “^1.0.0”, “rxjs”: “~6.6.0”, “tslib”: “^2.0.0”, “zone.js”: “~0.10.2” }, “devDependencies”: { “@angular-devkit/build-angular”: “~0.1002.0”, “@angular/cli”: “~10.2.0”, “@angular/compiler-cli”: “~10.2.0”, “@types/node”: “^12.11.1”, “@types/jasmine”: “~3.5.0”, “@types/jasminewd2”: “~2.0.3”, “codelyzer”: “^6.0.0”, “jasmine-core”: “~3.6.0”, “jasmine-spec-reporter”: “~5.0.0”, “karma”: “~5.0.0”, “karma-chrome-launcher”: “~3.1.0”, “karma-coverage-istanbul-reporter”: “~3.0.2”, “karma-jasmine”: “~4.0.0”, “karma-jasmine-html-reporter”: “^1.5.0”, “protractor”: “~7.0.0”, “ts-node”: “~8.3.0”, “tslint”: “~6.1.0”, “typescript”: “~4.0.2” } }

Scully/tsconfig.json

{ “compileOnSave”: false, “compilerOptions”: { “esModuleInterop”: true, “importHelpers”: false, “lib”: [“ES2019”, “dom”], “module”: “commonjs”, “moduleResolution”: “node”, “sourceMap”: true, “target”: “es2018”, “types”: [“node”], “skipLibCheck”: true, “skipDefaultLibCheck”: true, “typeRoots”: [“…/node_modules/@types”], “allowSyntheticDefaultImports”: true }, “exclude”: [“./**/*spec.ts”] }

Log entry: info using npm@6.14.6 3 info using node@v12.18.3 4 verbose run-script [ ‘prescully’, ‘scully’, ‘postscully’ ] 5 info lifecycle get-hydroponics-online@0.0.0~prescully: get-hydroponics-online@0.0.0 6 info lifecycle get-hydroponics-online@0.0.0~scully: get-hydroponics-online@0.0.0 7 verbose lifecycle get-hydroponics-online@0.0.0~scully: unsafe-perm in lifecycle true 8 verbose lifecycle get-hydroponics-online@0.0.0~scully: PATH: C:\Program . . . 9 verbose lifecycle get-hydroponics-online@0.0.0~scully: CWD: C:\Software Development\get-hydroponics-online 10 silly lifecycle get-hydroponics-online@0.0.0~scully: Args: [ ‘/d /s /c’, ‘scully’ ] 11 silly lifecycle get-hydroponics-online@0.0.0~scully: Returned: code: 15 signal: null 12 info lifecycle get-hydroponics-online@0.0.0~scully: Failed to exec scully script 13 verbose stack Error: get-hydroponics-online@0.0.0 scully: scully 13 verbose stack Exit status 15

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

9reactions
alessandro-tucci-visiontechcommented, Jul 14, 2021

@thinktank67 I run into your same problem. I was running Scully in a folder having a parent which contains whitespaces (which is pretty normal, on Windows).

I was able to make it work by applying on Scully’s JS files (yes, in the node_modules folder 😦 ) a fix which corresponds to turning this line: https://github.com/scullyio/scully/blob/6d55e6234b93754ea919e67f94aacdb1aeaf0c2c/libs/scully/src/lib/utils/compileConfig.ts#L109 into exec(`npx tsc -p "${configPath}"`, (err, res) => { (please note the double quotes)

After this fix, everything worked. @SanderElias , do you want me to open a specific issue for this?

0reactions
SanderEliascommented, Nov 6, 2020

For your process question. its a duplicate of #79

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript TS5042 Build: Option 'project' cannot be mixed with ...
The tsc command can be run in two ways: With a project parameter, which points to the directory that contains a tsconfig.json ....
Read more >
VSCode: error TS5042: Option 'project' cannot be mixed with ...
error TS5042 : Option 'project' cannot be mixed with source files on a command line. This error is all over the web and...
Read more >
Command Line Options - Scully.io
Starts the scully server. This process does not build the project. It only serves the Angular build files, and the Scully static files....
Read more >
Visual Studio Code Error with TypeScript Project - Allen Conway
error TS5042 : Option 'project' cannot be mixed with source files on a command line. The terminal process terminated with exit code: 1....
Read more >
tsatsiki - npm
tsc --project tsconfig.json index.ts # error TS5042: Option "project" cannot be mixed with source files on a command line.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found