Angular-cli: Getting the word 'error' instead of Version number on "ng --version"

Created on 7 Mar 2017  路  5Comments  路  Source: angular/angular-cli

OS?

Windows 8.1

Versions.

Node: 7.7.1
npm: 3.10.2

Mention any other details that might be useful.

ng --version returns following result with error on last 5 results:
@angular/cli: 1.0.0-rc.1
node: 7.7.1
os: win32 x64
@angular/compiler: error
@angular/compiler-cli: error
@angular/core: error
@ngtools/json-schema: error
@ngtools/webpack: error

Here is the path from where I executed ng --version command.
C:\Users\<YourUserName>\AppData\Roaming\npm\node_modules\angular-cli> ng --version

I do not get above output if I run ng --version command from any other windows path.

more info

All 5 comments

The logic to determine whether the current directory is within a CLI project is to check the dependencies within package.json. The CLI thinks it is within a CLI project here so it is trying to find the versions of the dependencies you see there, but they're not found so it shows error.

I'm not too concerned about this, can you please retry from these two locations:

  • A folder in you dev environment that is not a CLI project.
  • A folder inside of a CLI project

The first should yield just the CLI's version.
The second should yield the CLI's version as well as the other dependencies you see listed above.

Try executing: ng -v

Hope it helps.

Run npm install, fixed it for me.

This worked for me:

  1. delete node modules folder
  2. npm install

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings