I’m starting a new Capacitor project on MacOS, my first one. I create the project directory, cd to it, run npm init @capacitor/app@latest, and enter the project name, the app directory (I use “.”), and the App ID in reverse domain name notation. It always fails; the logfile contains:
0 verbose cli /usr/local/bin/node /usr/local/bin/npm
1 info using npm@11.6.2
2 info using node@v24.12.0
3 silly config load:file:/usr/local/lib/node_modules/npm/npmrc
4 silly config load:file:/Users/jsm/dev/fs-cap/.npmrc
5 silly config load:file:/Users/jsm/.npmrc
6 silly config load:file:/usr/local/etc/npmrc
7 verbose title npm init @capacitor/app@latest
8 verbose argv "init" "@capacitor/app@latest"
9 verbose logfile logs-max:10 dir:/Users/jsm/.npm/_logs/2026-07-10T17_21_07_669Z-
10 verbose logfile /Users/jsm/.npm/_logs/2026-07-10T17_21_07_669Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly packumentCache heap:2348810240 maxSize:587202560 maxEntrySize:293601280
13 silly logfile done cleaning log files
14 http fetch GET 200 https://registry.npmjs.org/@capacitor%2fcreate-app 501ms (cache revalidated)
15 silly packumentCache heap:2348810240 maxSize:587202560 maxEntrySize:293601280
16 verbose stack Error: command failed
16 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:22:22)
16 verbose stack at spawnWithShell (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:124:10)
16 verbose stack at promiseSpawn (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:12:12)
16 verbose stack at runScriptPkg (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script-pkg.js:79:13)
16 verbose stack at runScript (/usr/local/lib/node_modules/npm/node_modules/@npmcli/run-script/lib/run-script.js:9:12)
16 verbose stack at run (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/run-script.js:60:10)
16 verbose stack at async exec (/usr/local/lib/node_modules/npm/node_modules/libnpmexec/lib/index.js:307:10)
16 verbose stack at async Init.execCreate (/usr/local/lib/node_modules/npm/lib/commands/init.js:143:5)
16 verbose stack at async Init.exec (/usr/local/lib/node_modules/npm/lib/commands/init.js:46:14)
16 verbose stack at async Npm.exec (/usr/local/lib/node_modules/npm/lib/npm.js:208:9)
17 error code 1
18 error path /Users/jsm/dev/fs-cap
19 error command failed
20 error command sh -c "create-capacitor-app"
21 verbose cwd /Users/jsm/dev/fs-cap
22 verbose os Darwin 25.5.0
23 verbose node v24.12.0
24 verbose npm v11.6.2
25 verbose exit 1
26 verbose code 1
27 error A complete log of this run can be found in: /Users/jsm/.npm/_logs/2026-07-10T17_21_07_669Z-debug-0.log
I searched this forum and stackoverflow for clues but couldn’t find any.
Ultimately I’ll be migrating an existing Cordova app over to Capacitor, and develop it for both Android and iOS.
Related question: To migrate from Cordova, I plan to start a “new” Capacitor app and just copy over the web app files, rather than modifying the current app directory to be Capacitor. Is there any reason not to do it this way? I want to preserve the Cordova app. Alternately, I could cp -athe entire Cordova app directory, and then upgrade the copy to Capacitor.
Thanks for any help!