I am trying to update IOS platform to 4.1.0 for my Ionic app. But I'm getting below error while running the platform add command ionic platform add ios@4.1.0.
module.js:338
throw err;
^
Error: Cannot find module 'underscore'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.<anonymous> (/Users/harish/.cordova/lib/npm_cache/cordova-ios/4.1.0/package/node_modules/cordova-common/src/superspawn.js:23:9)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
Error: /Users/harish/.cordova/lib/npm_cache/cordova-ios/4.1.0/package/bin/create: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
Here is my system information:
Cordova CLI: 5.1.1 Ionic CLI Version: 1.7.14 Ionic App Lib Version: 0.7.0 ios-deploy version: 1.8.2 ios-sim version: 4.1.1 OS: Mac OS X El Capitan Node Version: v0.12.7 Xcode version: Xcode 7.3 Build version 7D175
thanks
Soumen
Same problem for me. (trying to implement push notifications for my ionic project)
I installed underscore with:
cd ~/.cordova/lib/npm_cache/cordova-ios/4.1.0/package/node_modules/
npm install underscore
And then update to 4.1.0: cordova platform update ios@4.1.0
After that you can do ionic build ios
perfectly!