SSH経由でサーバーにソフトウェアをインストールしようとしていますが、何らかの理由でnode.jsが見つかりません。それをインストールしてください」nodejsが見つかりませんでしたし、:。私は、エラーメッセージが表示されますなぜnodejが見つかりませんか?
#!/bin/bash
##Function Definition
pause() {
read -p "Press [Enter] key to exit"
}
cd $(dirname $0) # cd scr dir
if [ ! "$(id -u)" = 0 ] && [ ! -f ".readwarning" ]; then
echo "WARNING: Ogar uses priveleged ports by default, which may" \
"cause an error. Please either change the ports in the config" \
"file (gameserver.ini) to two different ports above 1024, or run" \
"this script as root. This warning will only be shown once, unless" \
"the file \".readwarning\" is deleted" 1>&2
touch .readwarning
sleep 5
fi
#Check which command to execute, nodejs (debian based) or node (others)
#This will give priority to nodejs
command -v nodejs &>/dev/null
if [ $? -eq 0 ]; then
nodejs index.js
else
command -v nodejs &>/dev/null
if [ $? -eq 0 ]; then
node index.js
else
nodejs index.js echo "Couldn't find nodejs. Please install it and ensure it is in your \$PATH"
fi
fi
# Pause
#pause
:
コードで、インストールスクリプトファイルを、参照するコマンドラインに'./public_html/server/Start-linux.sh'
:私はタイプそれがあなたの$ PATHにあることを確認してください "。
コマンドラインに 'node -v'と入力すると、 'v4.4.2'が返されますので、明らかにそこにあります。なぜそれが見つからないと言っているのですか? $ PATHとは何ですか? nodejsが私の$パスにあることをどうやって確認するのですか?
私はSSHとnode.jsの初心者ですので、どんな助力にも感謝します。私はLinuxのcentos 64bitシステムです。
や 'nodejs-遺産を設置するものである' nodejs'、へ 'node'指すようにあなたはシンボリックリンクを作ることができなければなりません'apt'経由のパッケージはDebian/Ubuntuであなたのために行います。 – mscdex
@mscdexこれは本当ですが、ここでは 'nodejs'が存在しない逆のことについて話しています。 – tadman