简体   繁体   English

在 Manjaro linux 上安装节点 js 和 npm 时出现问题

[英]Problem installing node js and npm on Manjaro linux

OS: Manjaro操作系统:Manjaro
I installed npm and nodejs by this command: sudo pacman -S nodejs npm我通过这个命令安装了npmnodejssudo 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?我怎么解决这个问题?

  1. Install nvm ( Node Version Manager )安装nvm节点版本管理器

     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.您还可以在环境文件(例如.bashrc )中添加上述行,这样您就不必每次都这样做。

  4. Install Node.js and npm安装Node.jsnpm

     nvm -g install npm
  5. Test your setup – open a new terminal and install a package using npm测试你的设置——打开一个新终端并使用npm安装一个包

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

I found that you need to install both nodejs and npm from the package manager.我发现你需要从包管理器中安装 nodejs 和 npm。 If you first install npm however, node is automatically installed as a dependency.但是,如果您首先安装 npm,则 node 会自动安装为依赖项。 yay -S npm

Installing:安装:

pamac install nodejs

pacman -S nodejs

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM