Open sarvosmi opened 1 year ago
Hi @sarvosmi on surface it does sound like could be a window's specific condition. Node 18 should be fine; you can also try Node 20 which is what a lot of us have been using past couple months.
The path printed looks odd but not sure if was just error on paste when you put that in.
\node_modules.bin\build-nativescript
should be:
\node_modules\.bin\build-nativescript
you could try invoking it directly outside of npm and using node, for example:
node node_modules\.bin\build-nativescript.mjs --env=platform=android
I'm seeing the same with Node 20.
> PROJECT@0.0.1 build:nativescript
> node --experimental-import-meta-resolve node_modules/.bin/build-nativescript
C:\Users\NAME\Projects\PROJECT\node_modules\.bin\build-nativescript:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at internalCompileFunction (node:internal/vm:77:18)
at wrapSafe (node:internal/modules/cjs/loader:1288:20)
at Module._compile (node:internal/modules/cjs/loader:1340:27)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
Node.js v20.10.0
ERROR: "build:nativescript" exited with 1.
It seems to be caused by the automatically added npm script:
"build:nativescript": "node --experimental-import-meta-resolve node_modules/.bin/build-nativescript",
Where it tries to execute node_modules/.bin/build-nativescript
(a shell script) using Node.
This line should be changed: https://github.com/NativeScript/capacitor/blob/203b85f65af1c7e2a6bb16f3de2d369c9f4bda44/src/postinstall.mts#L76
Followed the Installing @nativescript/capacitor steps for Ionic 7 capacitor app with this plugin but getting following error on running the cmd
npm run build:mobile
\node_modules.bin\build-nativescript:2 basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") ^^^^^^^
SyntaxError: missing ) after argument list at internalCompileFunction (node:internal/vm:73:18) at wrapSafe (node:internal/modules/cjs/loader:1176:20) at Module._compile (node:internal/modules/cjs/loader:1218:27) at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) at Module.load (node:internal/modules/cjs/loader:1117:32) at Module._load (node:internal/modules/cjs/loader:958:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47
Node.js v18.16.0 ERROR: "build:nativescript" exited with 1.
Please share every minor step required to include for Ionic 7 capacitor project running on windows