0

I am getting the following error when trying to use Angular CLI on Mac OS Sierra:

$ ng new my-app Error: Path "/app/app.module.ts" does not exist. Path "/app/app.module.ts" does not exist.

I have tried the following approaches:

Deleting NodeJS completely using the following commands: (as stated on this stackoverflow post)

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp

sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules

Then re-install Angular CLI

npm install -g @angular/cli

I have checked folder permissions and the information states that I have read/write access to the folder.

What else could be the problem here?

I now have the following versions:

  • Angular CLI: 1.7.1
  • Node: 8.9.4
  • OS: darwin x64
  • NPM: v5.6.0

Hope someone can help.

1 Answer 1

1

Ok I have solved the problem.

As well as doing all of the above. I noticed that a folder...

/Users/my-user-name/node_modules

... still existed. I did the following:

  1. Repeated the "Uninstall NodeJS" steps as listed in my original post.
  2. Deleted the node_modules folder found in /Users/my-user-name/node_modules
  3. Re-installed Node via the download link on the NodeJS website
  4. Re-installed Angular CLI npm install -g @angular/cli
  5. Created a new project ng new my-app
  6. Success!

Hopefully that helps anybody else who had similar issues.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.