(SOLVED) Error: Cannot find module 'C:\[...]\node_modules\cordova\bin\cordova'
See original GitHub issueDescription: When I want to deploy my app on my Android with "Ionic cordova run(or build) android, Powershell Says That cordova module cannot be found.
Steps to Reproduce:
run “ionic cordova run android”
Output:
PS C:\Users\smsma\Desktop\Prog. Stuff\ED2 Proyectos\Workbefy\App\Workbefy> ionic cordova run android --verbose
[DEBUG] Reason for not using local CLI: LOCAL_CLI_NOT_FOUND
[DEBUG] CLI flags: { interactive: true, confirm: false }
[DEBUG] { cwd: ‘C:\Users\smsma\Desktop\Prog. Stuff\ED2 Proyectos\Workbefy\App\Workbefy’, local: false, binPath:
‘C:\Users\smsma\AppData\Roaming\npm\node_modules\ionic\bin\ionic’, libPath:
‘C:\Users\smsma\AppData\Roaming\npm\node_modules\ionic\dist\index.js’ }
[DEBUG] Daemon found (pid: 7400)
Running app-scripts build: --platform android --target cordova
[11:37:43] build dev started …
[11:37:43] clean started …
[11:37:43] clean finished in 34 ms
[11:37:43] copy started …
[11:37:44] deeplinks started …
[11:37:44] deeplinks finished in 361 ms
[11:37:44] transpile started …
[11:37:56] transpile finished in 11.67 s
[11:37:56] preprocess started …
[11:37:56] preprocess finished in 1 ms
[11:37:56] webpack started …
[11:37:56] copy finished in 13.14 s
[11:38:16] webpack finished in 20.55 s
[11:38:16] sass started …
Without from
option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to undefined
to prevent this warning.
[11:38:20] sass finished in 3.48 s
[11:38:20] postprocess started …
[11:38:20] postprocess finished in 55 ms
[11:38:20] lint started …
[11:38:20] build dev finished in 36.85 s
cordova run android module.js:549 throw err; ^
Error: Cannot find module ‘C:\Users\smsma\Desktop\Prog. Stuff\ED2 Proyectos\Workbefy\App\Workbefy\node_modules\cordova\bin\cordova’ at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 [ERROR] An error occurred while running cordova run android (exit code 1).
[11:38:29] tslint: …og. Stuff/ED2 Proyectos/Workbefy/App/Workbefy/src/pages/categorias/categorias.ts, line: 303 ‘menu’ is declared but its value is never read.
L303: let menu: any;
[11:38:29] tslint: …og. Stuff/ED2 Proyectos/Workbefy/App/Workbefy/src/pages/categorias/categorias.ts, line: 5 All imports are unused.
L5: import { TrabajadorPage } from '../trabajador/trabajador';
L6: import { ResultadoBusquedaPage } from '../resultado-busqueda/resultado-busqueda';
[11:38:29] lint finished in 9.03 s [DEBUG] registerShutdownFunction process.exit/normal shutdown
My ionic info
:
cli packages: (C:\Users\smsma\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v8.11.1
npm : 5.6.0
OS : Windows 10
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro```
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (6 by maintainers)
Top GitHub Comments
Can you try the following anyway?
rm
is a tool to remove files and directories on every platform except Windows.