I install the latest version of framework7 and cordova.
When I run npm run build-cordova, show the next error:
\node_modules\rimraf\dist\cjs\src\index.js:24
throw new Error(‘invalid rimraf options’);
^
Error: invalid rimraf options
at assertRimrafOptions (C:\Users\0010263\Documents\MovilDemo\EjemploApp\node_modules\rimraf\dist\cjs\src\index.js:24:15)
at exports.default (C:\Users\0010263\Documents\MovilDemo\EjemploApp\node_modules\rimraf\dist\cjs\src\opt-arg.js:5:40)
at C:\Users\0010263\Documents\MovilDemo\EjemploApp\node_modules\rimraf\dist\cjs\src\index.js:36:46
at Object. (C:\Users\0010263\Documents\MovilDemo\EjemploApp\build\build.js:21:1)
at Module._compile (node:internal/modules/cjs/loader:1218:14)
at Module._extensions…js (node:internal/modules/cjs/loader:1272:10)
at Module.load (node:internal/modules/cjs/loader:1081:32)
at Module._load (node:internal/modules/cjs/loader:922: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.13.0
I have installed this version of framework7 and cordova:
framework7 --version
7.0.1
try to delete node_modules folder and run npm i, another solution would be to install rimraf as globa, npm i rimraf -g.
Maybe this discussion can help you Github
this problem happens due to some changes in rimraf package which a safe implementation of local rm -rf unix command which deletes folders in file system. this command used in build/build.js file you can fix the problem by changing:
rm('./cordova/www', (removeErr) => {
if (removeErr) throw removeErr;
in file to
rm('./cordova/www').then(() => {
doing this change won’t do any harm for your project. and since rimraf now uses promises it will throw the error automatically if occurred, so we don’t need if (removeErr) throw removeErr; command that we deleted.
Also seeing this exact same issue with Framework7 7.1.5
Just as an FYI, @hus201 's answer does seem to stop the error, but I’d like to see if this is something that can be fixed in the initial install instead of having to manually edit this file.