Question

I've cordova 3.4.0-0.1.3 installation on Ubuntu 12.04.4 LTS

cordova platforms list following options

Installed platforms:
Available platforms: android, blackberry10, firefoxos, ubuntu

Created the cordova project using

cordova create hello com.example.hello

Creating a new cordova project with name "HelloCordova" and id "com.example.hello" at location "/home/user/Workspace/cmsocial/bb/hello"

cd hello

But cordova platform add blackberry10 is giving following error

$cordova -d platform add blackberry10
cordova library for "blackberry10" already exists. No need to download. Continuing.
Checking if platform "blackberry10" passes minimum requirements...
Creating blackberry10 project...
Running command: /home/user/.cordova/lib/blackberry10/cordova/3.4.0/bin/create args=["/home/user/Workspace/cmsocial/test/platforms/blackberry10","com.example.test","HelloCordova"]

module.js:333
    throw err;
          ^
Error: Cannot find module 'exit'
    at Function.Module._resolveFilename (module.js:331:15)
    at Function.Module._load (module.js:273:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/home/user/.cordova/lib/blackberry10/cordova/3.4.0/bin/check_reqs.js:22:12)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Function.Module.runMain (module.js:490:10)
npm ERR! Error: EACCES, open '/home/user/.npm/d240d84e-localize-0-4-2.lock'
npm ERR!  { [Error: EACCES, open '/home/user/.npm/d240d84e-localize-0-4-2.lock']
npm ERR!   stack: 'Error: EACCES, open \'/home/user/.npm/d240d84e-localize-0-4-2.lock\'',
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/home/user/.npm/d240d84e-localize-0-4-2.lock' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.2.0-52-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! cwd /home/user/.cordova/lib/blackberry10/cordova/3.4.0
npm ERR! node -v v0.11.3
npm ERR! npm -v 1.2.25
npm ERR! path /home/user/.npm/d240d84e-localize-0-4-2.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/home/user/.npm/d240d84e-localize-0-4-2.lock'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/user/.cordova/lib/blackberry10/cordova/3.4.0/npm-debug.log
npm ERR! not ok code 0

module.js:333
    throw err;
          ^
Error: Cannot find module 'exit'
    at Function.Module._resolveFilename (module.js:331:15)
    at Function.Module._load (module.js:273:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/home/user/.cordova/lib/blackberry10/cordova/3.4.0/bin/create.js:30:12)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Function.Module.runMain (module.js:490:10)
Command finished with error code 8: /home/user/.cordova/lib/blackberry10/cordova/3.4.0/bin/create /home/user/Workspace/cmsocial/test/platforms/blackberry10,com.example.test,HelloCordova
Error: /home/user/.cordova/lib/blackberry10/cordova/3.4.0/bin/create: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:112:23)
    at ChildProcess.EventEmitter.emit (events.js:103:17)
    at maybeClose (child_process.js:735:16)
    at Process.ChildProcess._handle.onexit (child_process.js:802:5)

Any solution?

Was it helpful?

Solution

Able to fix this by removing the .npm and tmp folders in the home directory.

rm -rf ~/.npm/
rm -rf ~/tmp
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top