You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "BigBalli (via GitHub)" <gi...@apache.org> on 2026/04/02 18:48:12 UTC

Re: [I] SystemError [ERR_FS_CP_EINVAL]: Invalid src or dest: cp returned EINVAL during command cordova platform add android [cordova-cli]

BigBalli commented on issue #661:
URL: https://github.com/apache/cordova-cli/issues/661#issuecomment-4179806554

   Hey — it looks like the root cause here is having `node_modules` inside the `www/` folder. Cordova copies everything in `www/` into the platform assets, and when symlinks are present (like the ones npm creates in `.bin/`), the `fs.cp` call chokes trying to copy a symlink that points back into itself.
   
   Your workaround of deleting `www/node_modules/.bin` confirms this. The more permanent fix would be to avoid running `npm install` inside `www/` altogether — keep your frontend dependencies in the project root (or a separate `src/` folder) and use a build step to output only the final assets into `www/`. That way Cordova never tries to copy `node_modules` symlinks during `platform add`.
   
   Have you tried that approach? Curious if it fully resolves it for your workflow.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org