Closed tiagoapmartins closed 9 months ago
Hello @tiagoapmartins you are using yarn v1.22.19, could you also list: OS: Node:
Hi @ilhan007 Sorry for the late reply!
OS: Windows 11 Home Build 22621.ni_release.220506-1250 Node: v18.12.1
@hinzzx @nnaydenow could you try running the project on Windows, it will be easier for you and share your env: node, os, yarn
Hello,
I experience this exact same error on my personal PC. OS Name: Microsoft Windows 10 Pro OS Version: 10.0.19044 N/A Build 19044 yarn: 1.22.19 Node: 18.12.1
Hi @ilhan007,
I've run through the steps and seems that everything works on my machine. I'm sharing information about my machine setup:
Same issue here.
tried with
npm init @ui5/webcomponents-package
npm init @ui5/webcomponents-package@1.12.0-rc.1
npm init @ui5/webcomponents-package@1.12.0-rc.2
none of those work on my computer
[1] nps build.i18n exited with code 0
[2] file:///C:/Code/CrossClusterRefApp/WebC2/cpaxref-webcomponents/node_modules/zx/index.mjs:89
[2] let output = new ProcessOutput({
[2] ^
[2]
[2] ProcessOutput [Error]: /mnt/c/Code/CrossClusterRefApp/WebC2/cpaxref-webcomponents/node_modules/.bin/postcss: 11: exec: node: not found
[2] at file:///C:/Code/CrossClusterRefApp/WebC2/cpaxref-webcomponents/node_modules/@ui5/webcomponents-tools/lib/postcss-p/postcss-p.mjs:13:11
[2] exit code: 127 (Command not found)
[2] at ChildProcess.<anonymous> (file:///C:/Code/CrossClusterRefApp/WebC2/cpaxref-webcomponents/node_modules/zx/index.mjs:89:22)
[2] at ChildProcess.emit (node:events:527:28)
[2] at maybeClose (node:internal/child_process:1092:16)
[2] at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
[2] The script called "build.styles.themes" which runs "node "C:\Code\CrossClusterRefApp\WebC2\cpaxref-webcomponents\node_modules\@ui5\webcomponents-tools\lib\/postcss-p/postcss-p.mjs"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "build.styles" which runs "nps build.styles.themes build.styles.components" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "prepare.styleRelated" which runs "nps build.styles build.jsonImports build.jsImports" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] nps prepare.styleRelated exited with code 1
The script called "prepare.all" which runs "concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "prepare" which runs "cross-env UI5_TS=true nps clean prepare.all typescript generateAPI" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "start" which runs "nps prepare watch.devServer" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
node:child_process:902
throw err;
^
Systeminfo is: OS Name: Microsoft Windows 11 Enterprise OS Version: 10.0.22621 N/A Build 22621 node -v v16.15.1
The problem seems to originate from the nps build script in webcomponents-tools/components-package/nps.js
{
typescript: tsCommand,
build: {
default: "nps prepare lint build.bundle",
templates: `mkdirp dist/generated/templates && node "${LIB}/hbs2ui5/index.js" -d src/ -o dist/generated/templates`,
styles: {
default: `nps build.styles.themes build.styles.components ${copySrcGenerated}`,
themes: `node "${LIB}/postcss-p/postcss-p.mjs"`,
components: "postcss src/themes/*.css --config config/postcss.components --base src --dir dist/css/", // When updating this, also update the new files script
}}
When I remove the build.styles.themes
from default
the start script runs past this step but stumbles later.
Hi @ddNils,
Thanks for the provided information. We will take a look over it again.
Regards, Nayden
Hi @ddNils, @tiagoapmartins,
Could you please share which terminal you are using because I'm still not able to reproduce the problem even with the configuration provided by @ddNils?
Could you please check if the issue is still reproducible if you use git bash terminal?
Hint: compare your typescript versions / configurations
Hi @ddNils , @tiagoapmartins,
Based on @andekande hint could you share if you have globally installed typescript? In version 1.12.0-rc.2 we've added TypeScript as devDependency and I'm using it. https://www.npmjs.com/package/@ui5/create-webcomponents-package/v/1.12.0-rc.2.
Version should be:
npm tsc -v
8.19.3
I will have a look at rc2 again, but I suspect the problem lies somewhere else
I have updated to:
npm -v 8.19.3
tsc -v 5.0.2
node -v v16.19.1
still getting the same error, as mentioned before:
nps is executing `start` : nps prepare watch.devServer
nps is executing `prepare` : cross-env UI5_TS=true nps clean prepare.all typescript generateAPI
nps is executing `clean` : rimraf jsdoc-dist && rimraf src/generated && rimraf dist && rimraf .port && nps "scope.testPages.clean"
nps is executing `scope.testPages.clean` : rimraf test/pages/scoped
nps is executing `prepare.all` : concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"
[0] nps is executing `build.templates` : mkdirp dist/generated/templates && node "obscured\node_modules\@ui5\webcomponents-tools\lib\/hbs2ui5/index.js" -d src/ -o dist/generated/templates
[1] nps is executing `build.i18n` : nps build.i18n.defaultsjs build.i18n.json
[2] nps is executing `prepare.styleRelated` : nps build.styles build.jsonImports build.jsImports
[3] nps is executing `copy` : nps copy.src copy.props
[4] nps is executing `build.illustrations` :
[4] nps build.illustrations exited with code 0
[0] Templates generated
[0] nps build.templates exited with code 0
[1] nps is executing `build.i18n.defaultsjs` : node "obscured\node_modules\@ui5\webcomponents-tools\lib\/i18n/defaults.js" src/i18n src/generated/i18n
[3] nps is executing `copy.src` : node "obscured\node_modules\@ui5\webcomponents-tools\lib\/copy-and-watch/index.js" --silent "src/**/*.js" dist/
[2] nps is executing `build.styles` : nps build.styles.themes build.styles.components
[1] i18n default file generated.
[1] nps is executing `build.i18n.json` : node "obscured\node_modules\@ui5\webcomponents-tools\lib\/i18n/toJSON.js" src/i18n dist/generated/assets/i18n
[3] nps is executing `copy.props` : node "obscured\node_modules\@ui5\webcomponents-tools\lib\/copy-and-watch/index.js" --silent "src/**/*.properties" dist/
[1] Message bundle JSON files generated.
[2] nps is executing `build.styles.themes` : node "obscured\node_modules\@ui5\webcomponents-tools\lib\/postcss-p/postcss-p.mjs"
[1] nps build.i18n exited with code 0
[3] nps copy exited with code 0
[2] file:///obscured/node_modules/zx/index.mjs:89
[2] let output = new ProcessOutput({
[2] ^
[2]
[2] ProcessOutput [Error]: /mnt/c/Code/CrossClusterRefApp/WebC2/obscured/node_modules/.bin/postcss: 11: exec: node: not found
[2] at file:///C:/Code/CrossClusterRefApp/WebC2/obscured/node_modules/@ui5/webcomponents-tools/lib/postcss-p/postcss-p.mjs:13:11
[2] exit code: 127 (Command not found)
[2] at ChildProcess.<anonymous> (file:///C:/Code/CrossClusterRefApp/WebC2/obscured/node_modules/zx/index.mjs:89:22)
[2] at ChildProcess.emit (node:events:513:28)
[2] at maybeClose (node:internal/child_process:1100:16)
[2] at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
[2] The script called "build.styles.themes" which runs "node "obscured\node_modules\@ui5\webcomponents-tools\lib\/postcss-p/postcss-p.mjs"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "build.styles" which runs "nps build.styles.themes build.styles.components" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "prepare.styleRelated" which runs "nps build.styles build.jsonImports build.jsImports" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] nps prepare.styleRelated exited with code 1
The script called "prepare.all" which runs "concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "prepare" which runs "cross-env UI5_TS=true nps clean prepare.all typescript generateAPI" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "start" which runs "nps prepare watch.devServer" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
node:child_process:935
throw err;
^
Error: Command failed: npx nps "start"
at checkExecSyncError (node:child_process:861:11)
at Object.execSync (node:child_process:932:15)
at Object.<anonymous> (obscured\node_modules\@ui5\webcomponents-tools\bin\dev.js:16:15)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
at Module.load (node:internal/modules/cjs/loader:1069:32)
at Function.Module._load (node:internal/modules/cjs/loader:904:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47 {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 14952,
stdout: null,
stderr: null
}
@nnaydenow can you provide a script that outputs more detailed information on what is going on? Like raising the debug mode or something like that?
btw , I just tried the js version of this and it outputs the same - so it seems at least to my knowledge, it is not a typescript related problem. (also all above were tested with a administrative cmd, just in case...)
I did read my last few posts again and realized, that this might be misinterpreted. The init works properly. But the resulting project cannot be built. So running npm init @ui5/webcomponents-package
and npm i
works without problems. Building and starting the project however fails.
Hi @ddNils,
It's really strange issue and I'm still not able to reproduce the problem. These are the steps which I'm using and it works:
Could you share yours steps? Also could you write git log
and share the commit ID to check if it's related to specific commit?
My workflow was the following:
I tried your workflow as well and installed yarn globally for that. This is the output:
[1] Message bundle JSON files generated.
[1] nps build.i18n exited with code 0
[2] nps is executing `build.styles.themes` : node "obscuredWebC2\test4\ui5-webcomponents\packages\tools\lib\/postcss-p/postcss-p.mjs"
[3] nps copy exited with code 0
[2] file:///obscuredtest4/ui5-webcomponents/node_modules/zx/index.mjs:89
[2] let output = new ProcessOutput({
[2] ^
[2]
[2] ProcessOutput [Error]: /mnt/c/Code/CrossClusterRefApp/WebC2/test4/ui5-webcomponents/node_modules/.bin/postcss: 12: node: not found
[2] at file:///obscuredtest4/ui5-webcomponents/packages/tools/lib/postcss-p/postcss-p.mjs:13:11
[2] exit code: 127 (Command not found)
[2] at ChildProcess.<anonymous> (file:///obscuredtest4/ui5-webcomponents/node_modules/zx/index.mjs:89:22)
[2] at ChildProcess.emit (node:events:513:28)
[2] at maybeClose (node:internal/child_process:1100:16)
[2] at Process.ChildProcess._handle.onexit (node:internal/child_process:304:5)
[2] The script called "build.styles.themes" which runs "node "obscuredWebC2\test4\ui5-webcomponents\packages\tools\lib\/postcss-p/postcss-p.mjs"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "build.styles" which runs "nps build.styles.themes build.styles.components" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] The script called "prepare.styleRelated" which runs "nps build.styles build.jsonImports build.jsImports" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
[2] nps prepare.styleRelated exited with code 1
The script called "prepare.all" which runs "concurrently "nps build.templates" "nps build.i18n" "nps prepare.styleRelated" "nps copy" "nps build.illustrations"" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
The script called "prepare" which runs "cross-env UI5_TS=true nps clean prepare.all typescript generateAPI" failed with exit code 1 https://github.com/sezna/nps/blob/master/other/ERRORS_AND_WARNINGS.md#failed-with-exit-code
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed.
Exit code: 1
Command: C:\Program Files\nodejs\node.exe
Arguments: C:\Users\obscured\AppData\Roaming\nvm\v16.19.1\node_modules\yarn\lib\cli.js nps prepare
Directory: obscuredWebC2\test4\ui5-webcomponents\packages\main
Output:
info Visit https://yarnpkg.com/en/docs/cli/workspace for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "prepare:main" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "build:prerequisitesWithLint" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So as a workaround, I did change nps.js in \node_modules\@ui5\webcomponents-tools\components-package\nps.js
to use
themes: 'postcss src/**/parameters-bundle.css --config config/postcss.themes --base src --dir dist/css/',
instead of
`node "${LIB}/postcss-p/postcss-p.mjs"\`,
this seems to work fine for me as a workaround for the time being.
Hi @ddNils, @tiagoapmartins,
We've reworked our build process and how postcss works in our projects. I'm closing the issue since we are not able to reproduce the problem. Please ping me to reopen the issue if the problem still occurs.
Regards, Nayden
Issue Description
I was following the General Development Workflow guide and was unable to build the project
Issue Type