question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(SOLVED) Error: Cannot find module 'C:\[...]\node_modules\cordova\bin\cordova'

See original GitHub issue

Description: 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:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
imhoffdcommented, Jun 12, 2018

Can you try the following anyway?

rm -rf node_modules
npm install
0reactions
imhoffdcommented, Sep 6, 2018

rm is a tool to remove files and directories on every platform except Windows.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - Error: Cannot find module 'C:\Users\nguye\AppData ...
Uninstall node and npm, and reinstall. This will probably set the paths correctly in your system.
Read more >
Error: Cannot find module 'C:\Program Files\nodejs ... - GitHub
It's uncertain why I am getting this error after running npm cli command. Is it because nvm is pointing to that same path?...
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
In my case, I got it like this "Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\user\Desktop\Projects\Address ...
Read more >
Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >
[Solution] Error: Cannot Find Module "nodemailer" - Courier
This error occurs when you have not installed the nodemailer library in your Node.js application. Solution - Here's How To Resolve It. First,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found