在linux安裝nodejs,配置好環境變量後,node -v出錯: bash: /usr/local/node/bin/node: /lib/ld-linux.so.2: bad ELF inte

在linux安裝nodejs,配置好環境變量後,node -v出錯:

bash: /usr/local/node/bin/node: /lib/ld-linux.so.2: bad ELF interpreter: 沒有那個文件或目錄

按照提示的意思是解釋器出了問題,度娘了一下,應該這樣能解決:

##切忌不要輸入此命令,我自己給自己挖的坑,後面就能看到

sudo yum install glibc.i686

試一下:

node -v

報錯:

 error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

解決方式:

https://blog.csdn.net/wwwyuanliang10000/article/details/38661179

錯誤: Multilib version problems found. This often means that the root
      cause is something else and multilib version checking is just
      pointing out that there is a problem. Eg.:
      
        1. You have an upgrade for libstdc++ which is missing some
           dependency that another package requires. Yum is trying to
           solve this by installing an older version of libstdc++ of the
           different architecture. If you exclude the bad architecture
           yum will tell you what the root cause is (which package
           requires what). You can try redoing the upgrade with
           --exclude libstdc++.otherarch ... this should give you an error
           message showing the root cause of the problem.
      
        2. You have multiple architectures of libstdc++ installed, but
           yum can only see an upgrade for one of those architectures.
           If you don't want/need both architectures anymore then you
           can remove the one with the missing update and everything
           will work.
      
        3. You have duplicate versions of libstdc++ installed already.
           You can use "yum check" to get yum show these errors.
      
      ...you can also use --setopt=protected_multilib=false to remove
      this checking, however this is almost never the correct thing to
      do as something else is very likely to go wrong (often causing
      much more problems).
      
      保護多庫版本:libstdc++-4.8.5-36.el7.i686 != libstdc++-4.8.5-11.el7.x86_64

多版本問題,需要關閉保護

解決方式:

yum whatprovides libstdc++.so.6

 yum install --setopt=protected_multilib=false libstdc++-4.8.5-36.el7.i686
報錯:

Transaction check error:
  file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyc from install of libstdc++-4.8.5-36.el7.i686 conflicts with file from package libstdc++-4.8.5-11.el7.x86_64
  file /usr/share/gcc-4.8.2/python/libstdcxx/v6/printers.pyo from install of libstdc++-4.8.5-36.el7.i686 conflicts with file from package libstdc++-4.8.5-11.el7.x86_64
 

導致該問題原因是因爲版本衝突了,因爲之前使用了sudo yum install glibc.i686安裝了一個版本,現在又要安裝另外一個版本

解決方式:

yum update libstdc++-4.8.5-11.el7.x86_64

yum install --setopt=protected_multilib=false libstdc++-4.8.5-36.el7.i686
終於解決
--------------------- 
作者:喝粥也會胖的唐僧 
來源:CSDN 
原文:https://blog.csdn.net/zhou_438/article/details/85836450 
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章