Issue
I'm trying to follow the instructions on the https://capacitor-community.github.io/electron/#/ for adding the Capacitory Community Electron in a complete new Ionic Angular Test App, everything fine excepte when I need to add the plaftorm as instructions:
npx cap add @capacitor-community/electron
Getting the next error log:
> @capacitor-community/[email protected] capacitor:add
> node dist/cap-scripts.js add
× Adding Electron platform: The "path" argument must be of type string. Received undefined
node:internal/process/promises:227
triggerUncaughtException(err, true /* fromPromise */);
^
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:278:15)
at validateString (node:internal/validators:123:11)
at Object.join (node:path:397:7)
at Object.i [as getCwd] (C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:2:521)
at a (C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:6:197)
at Object.n [as doAdd] (C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:6:960)
at C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:363
at Object.g [as runTask] (C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:2:1902)
at i (C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:311)
at C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron\dist\cap-scripts.js:12:718 {
code: 'ERR_INVALID_ARG_TYPE'
}
npm ERR! code 1
npm ERR! path C:\Users\jfont\Documents\nexus\development\ionic\NomApp\node_modules\@capacitor-community\electron
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c node dist/cap-scripts.js add
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jfont\AppData\Local\npm-cache\_logs\2020-12-21T14_34_11_950Z-debug.log
When I'm using the capacitator electron plaftorm it works fine, but it says that it is Depracated and should use Capacitator Community Electron.
Thanks in advance.
Solution
It was a bug, I was using npm version 7.0.15. Fixed by updating npm:
npm install npm@latest
https://github.com/npm/cli/pull/2333
Answered By - Quimi Font
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.