Problem installing node js and npm on Manjaro linux

9.2k views Asked by At

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?

4

There are 4 answers

3
Gulshan Yadav On BEST ANSWER
  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
    
0
ZEN On

Installing:

pamac install nodejs

pacman -S nodejs

refer : https://discover.manjaro.org/packages/nodejs

0
OtienoSamwel On

I found that you need to install both nodejs and npm from the package manager. If you first install npm however, node is automatically installed as a dependency.

yay -S npm

0
Folaht On

Modified from Gulshan Yadav's answer.

  1. Install nvm (Node Version Manager)
sudo pacman -S nvm 
  1. Load nvm & add executable to bashrc
source /usr/share/nvm/init-nvm.sh
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' | tee -a ~/.bashrc
  1. Install Node.js and npm
nvm install stable
  1. Test your setup
npm install -g nativefier
nativefier --name Deepl "https://deepl.com"
cd Deepl-linux-x64
./Deepl