Getting the word 'error' instead of Version number on "ng --version"
OS?
Windows 8.1
Versions.
Node: 7.7.1 npm: 3.10.2
Mention any other details that might be useful.
ng --versionreturns 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: errorHere is the path from where I executed
ng --versioncommand.C:\Users\<YourUserName>\AppData\Roaming\npm\node_modules\angular-cli> ng --versionI do not get above output if I run
ng --versioncommand from any other windows path.
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:
- delete node modules folder
- 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.