0

I am trying to create my first angular app and While creating a new project using command 'ng new my-app' i am getting error like - No such file cli.js This is related to npm not being able to find the file. Image - cli.js not found while creating angular app

I tried various steps including changing the PATH env variable to point to the npm installation folder, but still the same issue. Also, while using a Seed project from Github and issuing command - npm install , again i get the same error. I am using node version 8.11.3. and following the steps given in https://angular.io/guide/quickstart#devenv

Has anyone faced this issue before?

  • Could you provide full error message? – Alexander Karmes Jul 14 '18 at 10:01
  • Hi Aleander, now i have provided a link of the error image – priya john Jul 14 '18 at 10:32
  • Please provide all the steps you took. What command did you use to install the @ngular/cli? It looks like the cli is trying to run from a local node_modules dir rather than global. – Martin Jul 14 '18 at 11:49
  • To install angular i have used - npm install -g @angular/cli. – priya john Jul 14 '18 at 12:37
  • try to install build optimizer locally: `npm i @angular-devkit/build-optimizer -D` or globally: `npm i @angular-devkit/build-optimizer -g` – Andriy Jul 14 '18 at 12:40
  • @Andriy I get the same error – priya john Jul 14 '18 at 13:25
  • This was finally solved by installing yarn. The project finally compiled successfully. Seems the issue was with the current node version installation itself. I thank everyone who replied to this post. I followed the steps mentioned in below link - https://stackoverflow.com/questions/49415958/what-could-cause-an-error-related-to-npm-not-being-able-to-find-a-file-no-conte – priya john Jul 14 '18 at 15:17

0 Answers0