danielrvt
danielrvt

Reputation: 10906

Update cordova project from 3.3 to 4.x

I'm having a lot of trouble updating a cordova project from 3.3 to 4.x. The documentation says that after updating de CLI I should execute:

cordova platform update iOS

But I get this error:

Error: Cannot find module 'shelljs'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/danielrvt/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/update:21:13)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
Error: /Users/danielrvt/.cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin/update: Command failed with exit code 8
    at ChildProcess.whenDone (/Users/danielrvt/.nvm/v0.10.33/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:756:16)

Can you help me with this update?

Upvotes: 3

Views: 1071

Answers (2)

Youssef Moawad
Youssef Moawad

Reputation: 2866

I had a similar problem. Try running the command with admin permissions (sudo).

sudo phonegap platform update ios

Then enter your password.

Upvotes: 0

Lars
Lars

Reputation: 120

I had the same issue. Found solution here: https://issues.apache.org/jira/browse/CB-8036

  1. install shelljs

    cd 
    cd .cordova/lib/npm_cache/cordova-ios/3.7.0/package/bin
    npm install shelljs
    
  2. cordova plaform update ios

That worked for me

Upvotes: 1

Related Questions