0

I am getting the following error while creating the angular4 new App.

Error:

Error: Path "/app/app.module.ts" does not exist.
Path "/app/app.module.ts" does not exist.

I have node version 9.4 and angular-cli version 1.7.1 and when I type like below.

subrajyoti@subrajyoti-H81M-S:/var/www/html/angular4-learning$ ng new myapp

I have also the write permission o this folder but still getting the above error. Here I need to resolve this error so that I can create new App.

3
  • This is strange, or you on Linux or OS X? Did you install the CLI globally or locally? Commented Mar 22, 2018 at 10:22
  • I am using Ubuntu and cli installed globally. Commented Mar 22, 2018 at 10:22
  • Do you have execute permission for those files? if not try chmod +x * in the app's root folder Commented Mar 22, 2018 at 12:27

2 Answers 2

1

I was also getting the same error, First I thought the issue is in npm but when I ran "npm audit" it shown me 0 vulnerabilities. Then I came to know that issue might be in angluar cli. So I have removed the angular cli, cleared the npm cache and install fresh angular cli.
It works!

Steps that I followed:

  1. npm uninstall -g @angular/cli
  2. npm install --cache /tmp/empty-cache
  3. npm install -g @angular/cli
  4. ng new NewProject
Sign up to request clarification or add additional context in comments.

Comments

0

I just attempted to recreate this issue without any luck. Steps:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli
ng new foo
This worked successfully for me.

macOs node: 8.9.0 npm: 5.6.0 @angular/cli: 1.6.3

1 Comment

I can create it from other directory location but particular from some directory it could not create.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.