Error rimraf when npm run build-cordova

Hello.

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

cordova --version
11.1.0

im actually experiencing the same thing…

I thought the problem are in the project path, but not is the problem. I tried to create a new project in the C unit and I have the problem like you.

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

I deleted the npm_modules folder and installed rimraf but the issue is the same.

mine, what i did is… i copied the cordova and paltform folders from the my old app folders and overwrite paste the app folder where it caused errors

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.

1 Like

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.

Created an issue report for this:

Hello.
I created a new project with the leatest version of framework7 and the line is already changed:

But I have the same problem:

Only happens when select Framework7 Core in a new framework7 project:

Hello.

This issue is fixed in the least framework7.
Only is necessary update the version.

try:
rm.windows('./cordova/www').then(() => {