Problem installing node js and npm on Manjaro linux

Issue

OS: Manjaro

I installed npm and nodejs by this command: sudo pacman -S nodejs npm

after installation i have an error:

~]$ npm -v
node: error while loading shared libraries: libicui18n.so.67: cannot open shared object file: No such file or directory
~]$ node --version
node: error while loading shared libraries: libicui18n.so.67: cannot open shared object file: No such file or directory

How can i solve this problem?

Solution

  1. Install nvm (Node Version Manager)

     yay -S nvm
    
  2. Load nvm

     source /usr/share/nvm/init-nvm.sh
    
  3. You can also add the above line in your environment file such as .bashrc so you won’t have to do it every time.

  4. Install Node.js and npm

     nvm -g install npm
    
  5. Test your setup – open a new terminal and install a package using npm

     $ nvm use stable
     $ nvm -g install browser-sync
     $ browser-sync start --server
    

Answered By – Gulshan Yadav

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published