Linux-3-Ubuntuの下で優雅に遊ぶNodeJSのインストール
1876 ワード
記事は最初にszhshpの第三国境研究所に転載されました.
Ubuntu 16.04 NodeJSをインストールする
どこにLinuxがNodeJSをインストールしてもこんなに面倒くさいです.
NodeJSインストール
NPMインストール
NPM、Nodeインストールが成功したら実行します.
The e e is a naming conflickt with the node package(Amature Packet Radio Node Program)、and the nodejs binary has been renamed from node to nodejs.You'll need to symlink/ust/bind/node off/am/am
もちろん、
解決方法はlinkを追加することです.
You need to manaualy create a symlink
npmのHexoのインストールに問題があります.
解決方法は公式ガイドをご覧ください.https://docs.npmjs.com/getting-started/fixing-npm-permissions
参考文献https://nodejs.org/en/download/package-manager/#debian-and-uuntu-based-linux-distributions http://www.cnblogs.com/seanlv/archive/2011/09/24/2189719.html https://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04 https://github.com/hexojs/hexo-util/issues/9
Ubuntu 16.04 NodeJSをインストールする
どこにLinuxがNodeJSをインストールしてもこんなに面倒くさいです.
NodeJSインストール
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
curl
が見つからないエラーがあるかもしれません.apt-get
を利用してください.NPMインストール
curl http://npmjs.org/install.sh | sudo sh
sudo apt-get install curl
node VS nodeJSNPM、Nodeインストールが成功したら実行します.
node -v
新聞の誤りを発見する-bash: /usr/sbin/node: No such file or directory
でも使えますnodejs -v
この問題の原因:The e e is a naming conflickt with the node package(Amature Packet Radio Node Program)、and the nodejs binary has been renamed from node to nodejs.You'll need to symlink/ust/bind/node off/am/am
もちろん、
curl
をそのまま使っても大丈夫ですが、その後modulesをインストールするとnodejs
のエラーが発生します.解決方法はlinkを追加することです.
You need to manaualy create a symlink
node
.Shotcut for bash comptible shells:sudo ln -s `which nodejs` /usr/bin/node
Or if you use non-standard shells、just hadcode the path you find with which nodejs:sudo ln -s /usr/bin/nodejs /usr/bin/node
NPM:Permission DeniednpmのHexoのインストールに問題があります.
node scripts/build_highlight_alias.js > highlight_alias.json
sh: 1: cannot create highlight_alias.json: Permission denied
sudoに変えてもエラーが発生します.解決方法は公式ガイドをご覧ください.https://docs.npmjs.com/getting-started/fixing-npm-permissions
参考文献