question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

global `ng version` shows errors instead of version numbers

See original GitHub issue

Versions

Angular CLI: 6.0.0-rc.7
Node: 9.9.0
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    <error>
@angular-devkit/core         <error>
@angular-devkit/schematics   <error>
@schematics/angular          <error>
@schematics/update           <error>
rxjs                         <error>

Repro steps

yarn global add @angular/cli@next
ng version

Observed behavior

Package                      Version
------------------------------------------------------
@angular-devkit/architect    <error>
@angular-devkit/core         <error>
@angular-devkit/schematics   <error>
@schematics/angular          <error>
@schematics/update           <error>
rxjs                         <error>

Desired behavior

Hide the errors if these packages are not supposed to be installed, or show me the version numbers.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

16reactions
rapric2115commented, May 15, 2018

I did have the same problem, what I did and work for me was uninstall angular globally, npm uninstall -g @angular/cli and installed again npm install -g @angular/cli@latest. And got all package installed without errors. Hope works for you too.

3reactions
9034725985commented, Sep 15, 2018

This looks somewhat related. The failure only happens with yarn global add but not with npm -g install. What could be the cause?

I tried this with Windows as well as KDE Neon (basically Ubuntu 16.04 Xenial) and it seems to be this way in both places.

neon@neon:~$ nvm --version
0.33.11
neon@neon:~$ nvm install node
Downloading and installing node v10.10.0...
Downloading https://nodejs.org/dist/v10.10.0/node-v10.10.0-linux-x64.tar.xz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v10.10.0 (npm v6.4.1)
Creating default alias: default -> node (-> v10.10.0)
neon@neon:~$ node --version
v10.10.0
neon@neon:~$ npm --version
6.4.1
neon@neon:~$ npm -g install yarn
/home/neon/.nvm/versions/node/v10.10.0/bin/yarn -> /home/neon/.nvm/versions/node/v10.10.0/lib/node_modules/yarn/bin/yarn.js
/home/neon/.nvm/versions/node/v10.10.0/bin/yarnpkg -> /home/neon/.nvm/versions/node/v10.10.0/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.9.4
added 1 package in 0.527s
neon@neon:~$ yarn --version
1.9.4
neon@neon:~$ which yarn
/home/neon/.nvm/versions/node/v10.10.0/bin/yarn
neon@neon:~$ yarn global add @angular/cli
yarn global v1.9.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "@angular/cli@6.2.2" with binaries:
      - ng
Done in 5.21s.
neon@neon:~$ ng --version
The program 'ng' is currently not installed. You can install it by typing:
sudo apt install ng-common
neon@neon:~$ yarn global bin
/home/neon/.yarn/bin
neon@neon:~$ cat ~/.bash
.bash_history  .bash_logout   .bashrc        
neon@neon:~$ cat ~/.bashrc 
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples

# If not running interactively, don't do anything
case $- in
    *i*) ;;
      *) return;;
esac

# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth

# append to the history file, don't overwrite it
shopt -s histappend

# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=1000
HISTFILESIZE=2000

# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize

# If set, the pattern "**" used in a pathname expansion context will
# match all files and zero or more directories and subdirectories.
#shopt -s globstar

# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi

# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
    xterm-color|*-256color) color_prompt=yes;;
esac

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
#force_color_prompt=yes

if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
        # We have color support; assume it's compliant with Ecma-48
        # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
        # a case would tend to support setf rather than setaf.)
        color_prompt=yes
    else
        color_prompt=
    fi
fi

if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi
unset color_prompt force_color_prompt

# If this is an xterm set the title to user@host:dir
case "$TERM" in
xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac

# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
fi

# colored GCC warnings and errors
#export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'

# some more ls aliases
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'

# Add an "alert" alias for long running commands.  Use like so:
#   sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

# Alias definitions.
# You may want to put all your additions into a separate file like
# ~/.bash_aliases, instead of adding them here directly.
# See /usr/share/doc/bash-doc/examples in the bash-doc package.

if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
fi

# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
neon@neon:~$ vim ~/.bashrc 
neon@neon:~$ source ~/.bashrc 
neon@neon:~$ which ng
/home/neon/.yarn/bin/ng
neon@neon:~$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 6.2.2
Node: 10.10.0
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    <error>
@angular-devkit/core         <error>
@angular-devkit/schematics   <error>
@schematics/angular          <error>
@schematics/update           <error>
rxjs                         <error>
    
neon@neon:~$ yarn global remove @angular/cli
yarn global v1.9.4
[1/2] Removing module @angular/cli...
[2/2] Regenerating lockfile and installing missing dependencies...
success Uninstalled packages.
Done in 0.40s.
neon@neon:~$ which ng
neon@neon:~$ npm -g install @angular/cli
/home/neon/.nvm/versions/node/v10.10.0/bin/ng -> /home/neon/.nvm/versions/node/v10.10.0/lib/node_modules/@angular/cli/bin/ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/cli@6.2.2
added 241 packages from 190 contributors in 16.175s
neon@neon:~$ which ng
/home/neon/.nvm/versions/node/v10.10.0/bin/ng
neon@neon:~$ ng --version
bash: /home/neon/.yarn/bin/ng: No such file or directory
neon@neon:~$ ls -a 
.   .bash_history  .bashrc  .config  Desktop    Downloads  .gtkrc-2.0  .local    Music  .nvm      .profile  .ssh                       Templates  .viminfo     .xsession-errors  .yarnrc
..  .bash_logout   .cache   .dbus    Documents  .gconf     .kde        .mozilla  .npm   Pictures  Public    .sudo_as_admin_successful  Videos     .Xauthority  .yarn
neon@neon:~$ vim ~/.bashrc 
neon@neon:~$ source ~/.bashrc 
neon@neon:~$ which ng
/home/neon/.nvm/versions/node/v10.10.0/bin/ng
neon@neon:~$ ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 6.2.2
Node: 10.10.0
OS: linux x64
Angular: 
... 

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.8.2
@angular-devkit/core         0.8.2
@angular-devkit/schematics   0.8.2
@schematics/angular          0.8.2
@schematics/update           0.8.2
rxjs                         6.2.2
typescript                   2.9.2
    
neon@neon:~$ 
Read more comments on GitHub >

github_iconTop Results From Across the Web

global `ng version` shows errors instead of version numbers
Changing directory to one of my project that had node_modules, then ng version showing the installed package versions correctly.
Read more >
the installed angular cli version is older than the latest stable ...
When I run the command ng update @angular/material@8 , I get the following: The installed Angular CLI version is older than the latest...
Read more >
[Solved]-global `ng version` shows errors instead of version ...
[Solved]-global `ng version` shows errors instead of version numbers-angular.js ... Try uninstalling the @angular/cli package globally with npm uninstall @angular ...
Read more >
Global Angular CLI version is greater than your local version
This tutorial guides you on how to fix Angular warning “Your global Angular CLI version is greater than your local version.
Read more >
@angular/cli | Yarn - Package Manager
The Angular CLI no longer supports 16.10.x , 16.11.x and 16.12.x . Current minimum versions of Node.js are 14.20.0 , 16.13.0 and 18.10.0...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found