Unable to build au2 on windows

I want to contribute a PR to AU2.
but I’m getting errors on fresh build without any changes.

googling the error did not helped.
anyone else got the same error? how did you fix it?

os: Microsoft Windows [Version 10.0.19042.867]
node: v14.16.0
npm: 7.8.0

Microsoft Windows [Version 10.0.19042.867]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd C:\Projects\aurelia

C:\Projects\aurelia>node -v
v14.16.0

C:\Projects\aurelia>npm -v
7.8.0

C:\Projects\aurelia>npm ci

added 1854 packages, and audited 1901 packages in 34s

131 packages are looking for funding
  run `npm fund` for details

14 vulnerabilities (8 low, 1 moderate, 5 high)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

C:\Projects\aurelia>npm run build

> @aurelia/monorepo@2.0.0-alpha.2 build
> lage build --scope @aurelia/* --scope aurelia --scope au --scope @benchmarking-apps/* --no-cache --verbose --no-deps

info Lage task runner - let's make it
verb filterPackages scope: @aurelia/__tests__,@aurelia/fetch-client,@aurelia/i18n,@aurelia/kernel,@aurelia/metadata,@aurelia/platform,@aurelia/platform-browser,@aurelia/router,@aurelia/route-recognizer,@aurelia/runtime,@aurelia/runtime-html,@aurelia/http-server,@aurelia/store,@aurelia/testing,@aurelia/validation,@aurelia/validation-html,@aurelia/validation-i18n,@aurelia/__tests__cjs,@aurelia/aot,@aurelia/plugin-gulp,@aurelia/plugin-parcel,@aurelia/plugin-conventions,@aurelia/webpack-loader,@aurelia/babel-jest,@aurelia/ts-jest,@benchmarking-apps/shared,@benchmarking-apps/aurelia2,@benchmarking-apps/runner,@benchmarking-apps/storage,@benchmarking-apps/test-result,@benchmarking-apps/viewer-server,@benchmarking-apps/viewer-client,aurelia,au
info @aurelia/metadata build ▶️ start
info @aurelia/platform build ▶️ start
info @aurelia/route-recognizer build ▶️ start
info @benchmarking-apps/shared build ▶️ start
info @benchmarking-apps/test-result build ▶️ start
verb @aurelia/metadata build |  Running C:\Program Files\nodejs\npm.CMD run build
verb @aurelia/platform build |  Running C:\Program Files\nodejs\npm.CMD run build
verb @aurelia/route-recognizer build |  Running C:\Program Files\nodejs\npm.CMD run build
verb @benchmarking-apps/shared build |  Running C:\Program Files\nodejs\npm.CMD run build
verb @benchmarking-apps/test-result build |  Running C:\Program Files\nodejs\npm.CMD run build
verb @benchmarking-apps/shared build |  > @benchmarking-apps/shared@1.0.0 build
verb @benchmarking-apps/shared build |  > tsc -b
verb @aurelia/metadata build |  > @aurelia/metadata@2.0.0-alpha.2 build
verb @aurelia/metadata build |  > tsc -b
verb @aurelia/platform build |  > @aurelia/platform@2.0.0-alpha.2 build
verb @aurelia/platform build |  > tsc -b
verb @benchmarking-apps/test-result build |  > @benchmarking-apps/test-result@1.0.0 build
verb @benchmarking-apps/test-result build |  > tsc -b; tsc -b ./tsconfig.cjs.json
verb @aurelia/route-recognizer build |  > @aurelia/route-recognizer@2.0.0-alpha.2 build
verb @aurelia/route-recognizer build |  > tsc -b
verb @benchmarking-apps/test-result build |  error TS6369: Option '--build' must be the first command line argument.
info @benchmarking-apps/test-result build ❌ fail
info 🏗 Summary
info
verb @aurelia/metadata build started - incomplete, took 0.00s
verb @aurelia/platform build started - incomplete, took 0.00s
verb @aurelia/route-recognizer build started - incomplete, took 0.00s
verb @benchmarking-apps/shared build started - incomplete, took 0.00s
verb @benchmarking-apps/test-result build failed, took 0.76s
info [Tasks Count] success: 0, skipped: 0, incomplete: 5
info ----------------------------------------------
ERR! [@benchmarking-apps/test-result build] ERROR DETECTED
ERR! started
ERR! Running C:\Program Files\nodejs\npm.CMD run build
ERR! > @benchmarking-apps/test-result@1.0.0 build
ERR! > tsc -b; tsc -b ./tsconfig.cjs.json
ERR! error TS6369: Option '--build' must be the first command line argument.
ERR! failed
info ----------------------------------------------
info Took a total of 0.77s to complete

C:\Projects\aurelia>


1 Like

From the error message:

error TS6369: Option '--build' must be the first command line argument.
ERR! failed

The build script of it looks like this

    "build": "tsc -b; tsc -b ./tsconfig.cjs.json",

it seems a bit weird. Maybe modify it in your local to

    "build": "tsc -b ./tsconfig.cjs.json",

and try again?

1 Like

after fixing that like you suggested + same fix in an other sub package,
this phase passes, but after that: new errors appears.

I’m not sure what’s wrong with my setup.
should I have tsc installed globally?
is the master branch the one I should try to build?

ERR! [@benchmarking-apps/storage build] ERROR DETECTED
ERR! started
ERR! Running C:\Program Files\nodejs\npm.CMD run build
ERR! > @benchmarking-apps/storage@1.0.0 build
ERR! > tsc -b ./tsconfig.cjs.json
ERR! src/index.ts(2,96): error TS7016: Could not find a declaration file for module '@benchmarking-apps/test-result'. 'C:/Projects/aurelia/test/benchmarking-apps/test-result/dist/cjs/index.js' implicitly has an 'any' type.
ERR!   Try `npm i --save-dev @types/benchmarking-apps__test-result` if it exists or add a new declaration (.d.ts) file containing `declare module '@benchmarking-apps/test-result';`
ERR! src/index.ts(6,15): error TS7016: Could not find a declaration file for module '@benchmarking-apps/test-result'. 'C:/Projects/aurelia/test/benchmarking-apps/test-result/dist/cjs/index.js' implicitly has an 'any' type.
ERR!   Try `npm i --save-dev @types/benchmarking-apps__test-result` if it exists or add a new declaration (.d.ts) file containing `declare module '@benchmarking-apps/test-result';`
ERR! failed
1 Like

What node version are you at @avrahamcool ? Working with win as well and no troubles

2 Likes

hi, @zewa666
this is my build.
(I also tries in another computer - same results)

1 Like

ahh I see, the min node version is 15 (but maybe 14 should work too … and we need to update the doc for this)

1 Like

wow… it’s actually already written in the docs.
https://docs.aurelia.io/community-contribution/building-and-testing-aurelia

I’m sorry I didn’t see that before.

2 Likes

unfortunately, that didn’t help.
got the same errors as before.

for now - I just deleted the test\benchmarking-apps folder locally.
and everything else builds fine.

1 Like

I have 2 windows machines, 1 works fine and the other also throwing the same thing. Will investigate this :+1:

2 Likes

Updating to latest nodejs, clearing caching and deleting plus npm ci dependencies worked for me

3 Likes

There’ 2 packages that has the build script that looks like this:

    "build": "tsc -b; tsc -b ./tsconfig.cjs.json",

When running the build script at the root level, I got this:

ERR! > tsc -b; tsc -b ./tsconfig.cjs.json
ERR! error TS6369: Option '--build' must be the first command line argument.

After deleting tsc -b; in the build script to get rid of that error, I got this error:

ERR! > tsc -b ./tsconfig.cjs.json
ERR! src/index.ts(2,96): error TS7016: Could not find a declaration file for module '@benchmarking-apps/test-result'. 'C:/Projects/aurelia-enhancement/test/benchmarking-apps/test-result/dist/cjs/index.js' implicitly has an 'any' type.
ERR!   Try `npm i --save-dev @types/benchmarking-apps__test-result` if it exists or add a new declaration (.d.ts) file containing `declare module '@benchmarking-apps/test-result';`

So I changed the build script to this

    "build": "tsc -b && tsc -b ./tsconfig.cjs.json"

to make it work. I didn’t set this up so I’m not exactly sure why it’s in this way, but that should unblock you :smiley:

4 Likes

I’ve also merged a commit that has this fix as well.

works perfectly.
thanks.

1 Like