incubator-annotator icon indicating copy to clipboard operation
incubator-annotator copied to clipboard

Can't build on windows

Open DellCliff opened this issue 4 years ago • 2 comments


> build
> concurrently yarn:build:*

yarn run v1.22.10
yarn run v1.22.10
yarn run v1.22.10
$ tsc --build
$ lerna exec --parallel -- cp ../../DISCLAIMER-WIP ../../LICENSE ../../NOTICE ../../README.md .
$ lerna exec --parallel -- babel -d lib -s -x .ts --env-name production --root-mode upward src
[build:misc] lerna notice cli v3.20.2
[build:js] lerna notice cli v3.20.2
[build:misc] lerna info Executing command in 3 packages: "cp ../../DISCLAIMER-WIP ../../LICENSE ../../NOTICE ../../README.md ."
[build:js] lerna info Executing command in 3 packages: "babel -d lib -s -x .ts --env-name production --root-mode upward src"
[build:misc] apache-annotator: 'cp' is not recognized as an internal or external command,
[build:misc] apache-annotator: operable program or batch file.
[build:misc] lerna ERR! cp ../../DISCLAIMER-WIP ../../LICENSE ../../NOTICE ../../README.md . exited 2 in 'apache-annotator'
[build:misc] lerna ERR! cp ../../DISCLAIMER-WIP ../../LICENSE ../../NOTICE ../../README.md . stderr:
[build:misc] 'cp' is not recognized as an internal or external command,
[build:misc] operable program or batch file.
[build:misc]
[build:misc] lerna ERR! cp ../../DISCLAIMER-WIP ../../LICENSE ../../NOTICE ../../README.md . exited 2 in 'apache-annotator'
[build:misc] lerna WARN complete Waiting for 2 child processes to exit. CTRL-C to exit immediately.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
[build:misc] yarn run build:misc exited with code 2
[build:js] apache-annotator: Successfully compiled 2 files with Babel (2140ms).
[build:types] packages/apache-annotator/src/dom.ts(32,15): error TS7016: Could not find a declaration file for module '@apache-annotator/dom'. 'xxxxx/packages/dom/lib/index.js' implicitly has an 'any' type.
[build:types]   Try `npm i --save-dev @types/apache-annotator__dom` if it exists or add a new declaration (.d.ts) file containing `declare module '@apache-annotator/dom';`
[build:types] packages/dom/test/utils.ts(22,31): error TS6305: Output file 'xxxxx/packages/dom/lib/owner-document.d.ts' has not been built from source file 'xxxxx/packages/dom/src/owner-document.ts'.
[build:types] packages/dom/test/css/describe.test.ts(22,29): error TS6305: Output file 'xxxxx/packages/dom/lib/css.d.ts' has 
not been built from source file 'xxxxx/packages/dom/src/css.ts'.
[build:types] packages/dom/test/css/match.test.ts(23,42): error TS6305: Output file 'xxxxxx/packages/dom/lib/css.d.ts' has not been built from source file 'xxxxxx/packages/dom/src/css.ts'.
[build:types] packages/dom/test/highlight-text/highlight-text.test.ts(22,31): error TS6305: Output file 'xxxxxx/packages/dom/lib/highlight-text.d.ts' has not been built from source file 'xxxxxx/packages/dom/src/highlight-text.ts'.
[build:types] packages/dom/test/range/cartesian.test.ts(22,27): error TS6305: Output file 'xxxxxx/packages/dom/lib/range/cartesian.d.ts' has not been built from source file 'xxxxxx/packages/dom/src/range/cartesian.ts'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 2.
[build:types] yarn run build:types exited with code 2
[build:js] @apache-annotator/selector: Successfully compiled 10 files with Babel (4244ms).
[build:js] @apache-annotator/dom: Successfully compiled 16 files with Babel (4440ms).
[build:js] lerna success exec Executed command in 3 packages: "babel -d lib -s -x .ts --env-name production --root-mode upward src"
Done in 6.79s.
[build:js] yarn run build:js exited with code 0

DellCliff avatar Jul 12 '21 20:07 DellCliff

@DellCliff what shell are you using? PowerShell? CMD? Bash for Windows (which typically installs with git)?

BigBlueHat avatar Jul 15 '21 15:07 BigBlueHat

@BigBlueHat CMD and PowerShell. Same error in both.

DellCliff avatar Jul 15 '21 16:07 DellCliff

Hi, I have submitted #132 to solve 'cp' is not recognized as an internal or external command,.

However, on my Windows system, I still get the following error after that small fix:

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'

This looks like an issue with babel-register-esm and how Windows file paths are structured with the drive letter. AFAICT this loader is only used for the Mocha tests - so I'm currently investigating how I can mitigate these build issues further on Windows.

PermissionError avatar Nov 15 '22 00:11 PermissionError

I've submitted a potential fix to the ESM loader at giltayar/babel-register-esm#3.

PermissionError avatar Nov 15 '22 01:11 PermissionError

Thanks for investigating! Once (if) the remaining issue is fixed upstream be welcome to make a PR with the dependency upgrade.

Treora avatar Nov 16 '22 09:11 Treora