Invalid Version error coming when I try to create new project


#1

I have CentOS VM box. The below command is throwing error

./ionic start todo blank

TypeError: Invalid Version: Not installed
    at new SemVer (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/node_modules/semver/semver.js:295:11)
    at Range.test (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/node_modules/semver/semver.js:1049:15)
    at Function.satisfies (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/node_modules/semver/semver.js:1098:16)
    at Object.checkRuntime (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/info.js:295:32)
    at Object.run (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/lib/cli.js:54:10)
    at Object.<anonymous> (/home/chirag/node-v0.12.7-linux-x64/lib/node_modules/ionic/bin/ionic:9:10)
    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 Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Invalid Version: Not installed (CLI v1.6.4)

Your system information:

Cordova CLI: Not installed
Ionic CLI Version: 1.6.4
Ionic App Lib Version: 0.3.8
OS: Distributor ID:     CentOS Description:     CentOS release 6.5 (Final)
Node Version: v0.12.7

Thanks in advance

CSJakharia


#2

Looks like Cordova isn’t installed, try running:

npm install -g cordova


#3

Output of cordova installation command

 ./npm install -g cordova
npm ERR! not a package /home/chirag/node-v0.12.7-linux-x64/bin/cordova
npm ERR! addLocal Could not install /home/chirag/node-v0.12.7-linux-x64/bin/cordova
npm ERR! Linux 2.6.32-431.el6.x86_64
npm ERR! argv "/home/chirag/node-v0.12.7-linux-x64/bin/node" "/home/chirag/node-v0.12.7-linux-x64/bin/npm" "install" "-g" "cordova"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! path /tmp/npm-10834-930e72d2/unpack-292f5553d1a9/package.json
npm ERR! code ENOENT
npm ERR! errno -2

npm ERR! enoent ENOENT, open '/tmp/npm-10834-930e72d2/unpack-292f5553d1a9/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     /home/chirag/node-v0.12.7-linux-x64/bin/npm-debug.log

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/home/chirag/node-v0.12.7-linux-x64/bin/node',
1 verbose cli   '/home/chirag/node-v0.12.7-linux-x64/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'cordova' ]
2 info using npm@2.11.3
3 info using node@v0.12.7
4 verbose install initial load of /home/chirag/node-v0.12.7-linux-x64/lib/package.json
5 verbose readDependencies loading dependencies from /home/chirag/node-v0.12.7-linux-x64/lib/package.json
6 silly cache add args [ 'cordova', null ]
7 verbose cache add spec cordova
8 silly cache add parsed spec { raw: 'cordova',
8 silly cache add   scope: null,
8 silly cache add   name: null,
8 silly cache add   rawSpec: 'cordova',
8 silly cache add   spec: '/home/chirag/node-v0.12.7-linux-x64/bin/cordova',
8 silly cache add   type: 'local' }
9 silly addLocalTarball shasum (computed) 02d8f6cf2e3cbcda7563cf1f499ad32b8388b49a
10 verbose addTmpTarball /home/chirag/node-v0.12.7-linux-x64/bin/cordova not in flight; adding
11 verbose addTmpTarball validating metadata from /home/chirag/node-v0.12.7-linux-x64/bin/cordova
12 verbose tar unpack /home/chirag/node-v0.12.7-linux-x64/bin/cordova
13 verbose tar unpacking to /tmp/npm-10834-930e72d2/unpack-292f5553d1a9
14 silly gentlyRm /tmp/npm-10834-930e72d2/unpack-292f5553d1a9 is being purged
15 verbose gentlyRm don't care about contents; nuking /tmp/npm-10834-930e72d2/unpack-292f5553d1a9
16 silly gunzTarPerm modes [ '775', '664' ]
17 error not a package /home/chirag/node-v0.12.7-linux-x64/bin/cordova
18 error addLocal Could not install /home/chirag/node-v0.12.7-linux-x64/bin/cordova
19 verbose stack Error: ENOENT, open '/tmp/npm-10834-930e72d2/unpack-292f5553d1a9/package.json'
19 verbose stack     at Error (native)
20 verbose cwd /home/chirag/node-v0.12.7-linux-x64/bin
21 error Linux 2.6.32-431.el6.x86_64
22 error argv "/home/chirag/node-v0.12.7-linux-x64/bin/node" "/home/chirag/node-v0.12.7-linux-x64/bin/npm" "install" "-g" "cordova"
23 error node v0.12.7
24 error npm  v2.11.3
25 error path /tmp/npm-10834-930e72d2/unpack-292f5553d1a9/package.json
26 error code ENOENT
27 error errno -2
28 error enoent ENOENT, open '/tmp/npm-10834-930e72d2/unpack-292f5553d1a9/package.json'
28 error enoent This is most likely not a problem with npm itself
28 error enoent and is related to npm not being able to find a file.
29 verbose exit [ -2, true ]

#5

Have you tried some drastic clean?

rm -rf ~/.npm
npm cache clear

#6

Have tried the same but again same exception on running ./npm install -g cordova

Thanks in advance

CSJakharia


#7

Try:

sudo npm install -g cordova


#8

I have tried the command using the root login but the same error is coming

CSJakharia