cordova-background-geolocation-SampleApp: Cannot find module '@ionic/cli-utils/lib/init'

ionic cordova platform add ios gets me the following:

{ Error: Cannot find module '@ionic/cli-utils/lib/init' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object.<anonymous> (/Users/User/cordova-background-geolocation-SampleApp/node_modules/ionic/dist/index.js:8:16) at Module._compile (module.js:569:30) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) at Function.Module._load (module.js:458:3) code: 'MODULE_NOT_FOUND' }

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (13 by maintainers)

Most upvoted comments

@christocracy You can just run application after the following step 1.Delete node_modules 2. Delete package-lock.json file 3. Run npm install command then run the application(I used ionic serve cmd using terminal). I followed these steps and solved my problem.

I fixed the issue.

  1. I removed the @ionic/cli-utils dependency from package-lock.json
  2. Then I got the same error for inquirer. To fix that I installed inquirer@latest
  3. Then I got an error about node sass. To fix that I did npm rebuild node-sass
  4. I reran ionic cordova build ios and it worked!