Also, after solving this error, there was another error after running this command:
npm run action client/src/cordova/build android
Regarding the script action is not defined. This was solved by adding this line of script to package.json
file:
"scripts": {
"action": "cd src/cordova && cordova build android --verbose"
}
And then by npm run action
, the application was built successfully.