2

I am using ubuntu 16 OS and my node and npm versions are as below

node v7.4.0

npm 4.0.5

if i give ng new my-project i am getting below error

It seems like you're using a project generated using an old version of the Angular CLI. The latest CLI now uses webpack and has a lot of improvements including a simpler workflow, a faster build, and smaller bundles.

To get more info, including a step-by-step guide to upgrade the CLI, follow this link: https://github.com/angular/angular-cli/wiki/Upgrading-from-Beta.10-to-Beta.14

Please help me on this

6
  • It seems the folder in which you are executing ng new my-project has other files e.g. package.json etc. Execute it in a folder that does not have any other files (no problems if there are folders, but not with the same name as your new project). Commented Jan 27, 2017 at 8:12
  • i have created new empty folder and tried i am getting the same error. But in /etc/ folder or in /opt/* folders i am able to run ng -v. Commented Jan 27, 2017 at 8:23
  • Did you have previous version of angular-cli installed? If yes, did you uninstall it before installing latest version? Commented Jan 27, 2017 at 8:26
  • yes i have unistalled angular-cl, then cleared npm cache then again installed it. Commented Jan 27, 2017 at 8:28
  • 1
    OK... try this.... uninstall angular-cli... clean npm cache... delete folder /usr/local/lib/node_modules/angular-cli (or folder angular-cli from your global npm_modules folder). Reinstall angular-cli and try creating new project. Commented Jan 27, 2017 at 8:36

1 Answer 1

4

Do following steps:

  • Uninstall anguar-cli and clean npm cache by executing the following:

    npm uninstall -g angular-cli

    npm cache clean

  • Delete folder /usr/local/lib/node_modules/angular-cli (or folder angular-cli from your global npm_modules folder).

  • Reinstall angular-cli using npm install -g angular-cli@latest and then try creating new project.

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.