node.jsangularnpmangular-cli

'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI v6


enter image description hereI have following versions installed on my system: node : v8.12.0 npm : 6.4.1

Now, when I try to run ng --version or any other command starting with ng, I am getting following error :

#!/usr/bin/env node
'use strict';

// Provide a title to the process in `ps`.
// Due to an obscure Mac bug, do not start this title with any symbol.
try {
  process.title = 'ng ' + Array.from(process.argv).slice(2).join(' ');
} catch(_) {
  // If an error happened above, use the most basic title.
  process.title = 'ng';
}

// Some older versions of Node do not support let or const.
var version = process.version.substr(1).split('.');
if (Number(version[0]) < 8 || (Number(version[0]) === 8 && Number(version[1]) < 9)) {
  process.stderr.write(
    'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI v6.\n' +
    'The official Node.js version that is supported is 8.9 and greater.\n\n' +
    'Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.\n'
  );

  process.exit(3);
}

require('../lib/init');

when I type ng I get following message (see image) Any help is much appreciated !!!!


Solution

  • I have been trying to fix this issue. Finally I found out that the path variable that I was setting was not correct . then I gave it correct path where ng is downloaded inside Appdata-> Roaming and it started working.

    Hope It might help someone.