ng new project - The system cannot find the path specified

Viewed 3023

I'm trying to create an angular 4 project using angular-cli on Windows 10.

I followed the steps provided in https://www.npmjs.com/package/@angular/cli.

I have node - 7.6.0 ; npm - 5.1.0.

Whenever I run ng new my-app , i get the following error G:\Projects\FS_20XX>"$basedir/../../Users/xxxxxx/AppData/Local/Yarn/config/global/node_modules/.bin/ng.cmd" "$@" The system cannot find the path specified.

I'm getting the same error when i use ng help too.

Could some one please help me.

2 Answers

Ther are a few steps to resolve this problem:-

  1. Step-1. Uninstall Angular CLI by using: npm uninstall -g @angular/cli
  2. Step-2. clear npm cache by using: npm cache clean --force
  3. Step-3. Uninstall Node JS from control panel.
  4. Step-4. Restart your PC.
  5. Step-5. Install Node JS LTS Version - Recommended For Most Users form here!.
  6. Step-6. Install Angular CLI by using: npm install -g @angular/cli

Now the problem resolved. "Happy Coding..."

I had the same problem for quite time.

The solution I found was that node was globally installed with npm and this caused conflicts.

  • Check if you have two versions of node
  • If you have, Go to your npm path "%AppData%/Roaming/npm" and the node and node.cmd file.
Related