0

I installed Angular and when I write a ng command I get this screen enter image description here

If I choose Google Chrome I get a script page

#!/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]) < 10 || (Number(version[0]) === 10 && Number(version[1]) < 9)) {
  process.stderr.write(
    'You are running version ' + process.version + ' of Node.js, which is not supported by Angular CLI 8.0+.\n' +
    'The official Node.js version that is supported is 10.9 or 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');

Anyone please know about possible solutions?

sharon
  • 1
  • 1
  • Does this help? https://stackoverflow.com/questions/51511183/ng-command-not-found – JWP Apr 01 '20 at 23:03
  • No, I tried everything from there and the problem was repeated – sharon Apr 02 '20 at 08:37
  • Ok maybe 1) Delete you node modules folder. 2) ng update will give you the latest angular package which is now at 9.1. Note I have had to more than once run ng update just to get the CLI running. Then, I've had to separately use npm install to sync up both global and local versions of Angular... I almost always see dependency warnings but mostly ignore them. – JWP Apr 02 '20 at 14:50
  • 1
    Thanks, in the end I used powershell (by the command line it didn't work) and reinstalled nodejs in a different version than the one I had, and it worked – sharon Apr 02 '20 at 17:33

0 Answers0