Node scripts and cordova

Perhaps by design for security, but I can’t load a script in the node_modules folder when viewing in design mode…ERR_FILE_NOT_FOUND

It does work in the browser though.

Is there a better way to load node scripts?

EDIT: Okay, so it would seem npm_modules folder does not get deployed by cordova. Quick fix is to copy over to www/js but that seems hacky. I’m guessing cordova hook scripts???

1 Like

node_modules doesn’t get deployed indeed, as they mostly consist of build scripts or specific nodejs scripts that doesn’t have anything to do with mobile (nodejs doesn’t run there)

What other scripts do you have in your node_modules?

I installed a star rating library that ended up in there. Thanks for the background, I’ll list leave the copy I made in the js folder since that is working everywhere.