Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
thinktank67 opened this issue Oct 30, 2020 · 10 comments
Labels
bug Something isn't working

Comments

@thinktank67
Copy link

🐞 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! @0.0.0 scully: scully
npm ERR! Exit status 15
npm ERR!
npm ERR! Failed at the @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.0prescully: 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.0scully: 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.0scully: 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.0scully: 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

@thinktank67 thinktank67 added the bug Something isn't working label Oct 30, 2020
@SanderElias
Copy link
Contributor

@thinktank67 I can't reproduce this. (I don't have access to a windows machine)
By any chance, are you using PowerShell? We have seen some issues with PowerShell before. Most notably, specs or upper-case letters in pathnames seem to be an issue there.

@ataherinmobly
Copy link

it is happening with me as well in both vscode terminal and in an ubuntu terminal installed on windwos

@SanderElias
Copy link
Contributor

@ataherinmobly @thinktank67
I would love a repo that shows this issue. It doesn't reproduce for me.

@SanderElias
Copy link
Contributor

@ataherinmobly @thinktank67
I just noticed you used Version 1.0.0 of Scully and 4.0.2 of typescript.
Can you update both to the latest?

@thinktank67
Copy link
Author

Hi this was the test app I'm using to setup Scully
get-hydroponics-online (2).zip

@thinktank67
Copy link
Author

I've updated to the lastest scully:
"@scullyio/init": "~1.0.1",
"@scullyio/ng-lib": "~1.0.0",
"@scullyio/scully": "^1.0.4",
Type script seems to be at the latest available version but I'm still having the same issue. I also tried running the command in a command window instead of using powershell but still no joy

@SanderElias
Copy link
Contributor

@thinktank67
I did unpack your app:
image
I used npx so I was sure to use local installed packages. I did also a run with npm run scully
Also worked.
DM me somewhere and I'll try to look with you at this.
Windows seems to have issues with certain chars in the path-name.
Are you sure you are in a folder without spaces or uppercase chars? Perhaps its the path depth?

@SanderElias SanderElias changed the title rror TS5042: Option 'project' cannot be mixed with source files on a command line when running npm run scully Error TS5042: Option 'project' cannot be mixed with source files on a command line when running npm run scully Nov 5, 2020
@thinktank67
Copy link
Author

thinktank67 commented Nov 5, 2020

Hi appologies, there was a space in the full execution path. I didn't check as I run all my angular projection under this path ok. I have however come across another problem now when I run Scully, could you suggest what this could be related too? Every time I run npm run scully it returns a different "ERROR: The process "6872" not found". It does appear to work though, it creates the static files etc when I run npm run scully:serve

get-hydroponics-online@0.0.0 scully C:\affiliate-marketing\get-hydroponics-online
scully

using plugins from folder "./scully"
☺ new Angular build imported
☺ Started servers in background
Finding all routes in application.
⠸ warming up

Using stored unhandled routes!.
To discover new routes in the angular app use "npm run scully -- --scanRoutes"

Pull in data to create additional routes.
Route list created in files:
".\src\assets\scully-routes.json",
"C:\affiliate-marketing\get-hydroponics-online\dist\static\assets\scully-routes.json",
"C:\affiliate-marketing\get-hydroponics-online\dist\get-hydroponics-online\assets\scully-routes.json"

Route "/" rendered into file: ".\dist\static\index.html"
Route "/test" rendered into file: ".\dist\static\test\index.html"

Generating took 1.89 seconds for 2 pages:
That is 1.06 pages per second,
or 948 milliseconds for each page.

Finding routes in the angular app took 6 milliseconds
Pulling in route-data took 1 milliseconds
Rendering the pages took 1.1 seconds

⠋ ERROR: The process "17660" not found.

@SanderElias
Copy link
Contributor

For your process question. its a duplicate of #79

@alessandro-tucci-visiontech
Copy link

@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:

exec(`npx tsc -p ${configPath}`, (err, res) => {

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?

@ghost ghost mentioned this issue Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants