Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 在被囚禁的shell上安装node.js_Linux_Node.js_Installation - Fatal编程技术网

Linux 在被囚禁的shell上安装node.js

Linux 在被囚禁的shell上安装node.js,linux,node.js,installation,Linux,Node.js,Installation,我正在尝试在共享web服务器的监禁外壳上安装node.js。我已经安装了git,并获得了node.js的副本。我是这样编译的 ./configure --prefix=~/opt /home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc: In function `void* v8::internal::ThreadEntry(void*)': /home/sparrow/bin/git/node-v0.4.12/deps

我正在尝试在共享web服务器的监禁外壳上安装node.js。我已经安装了git,并获得了node.js的副本。我是这样编译的

./configure --prefix=~/opt
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc: In function `void* v8::internal::ThreadEntry(void*)':
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: error: `PR_SET_NAME' was not declared in this scope
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: warning: unused variable 'PR_SET_NAME'
scons: *** [obj/release/platform-linux.o] Error 1
scons: building terminated because of errors.
Waf: Leaving directory `/home/sparrow/bin/git/node-v0.4.12/build'
Build failed:  -> task failed (err #2): 
        {task: libv8.a SConstruct -> libv8.a}
make: *** [program] Error 1
(我有一个允许git执行的
~/opt/bin
目录,所以我认为这是一个放置git的好地方)

但是有这样的错误

./configure --prefix=~/opt
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc: In function `void* v8::internal::ThreadEntry(void*)':
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: error: `PR_SET_NAME' was not declared in this scope
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: warning: unused variable 'PR_SET_NAME'
scons: *** [obj/release/platform-linux.o] Error 1
scons: building terminated because of errors.
Waf: Leaving directory `/home/sparrow/bin/git/node-v0.4.12/build'
Build failed:  -> task failed (err #2): 
        {task: libv8.a SConstruct -> libv8.a}
make: *** [program] Error 1
有人知道这个错误意味着什么吗?我如何修复我的安装

编辑:更多详细信息

我又试了一次,但是使用了
/configure--prefix=~/usr/local/
,出现了类似的错误-下面是输出

-jailshell-3.00$ ./configure --prefix=~/local
Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for program gcc or cc           : /usr/bin/gcc 
Checking for gcc                         : ok  
Checking for library dl                  : yes 
Checking for openssl                     : yes 
Checking for library util                : yes 
Checking for library rt                  : yes 
--- libeio ---
Checking for library pthread             : yes 
Checking for function pthread_create     : yes 
Checking for function pthread_atfork     : yes 
Checking for futimes(2)                  : yes 
Checking for readahead(2)                : yes 
Checking for fdatasync(2)                : yes 
Checking for pread(2) and pwrite(2)      : no 
Checking for sendfile(2)                 : yes 
Checking for sync_file_range(2)          : no 
--- libev ---
Checking for header sys/inotify.h        : not found 
Checking for header sys/epoll.h          : yes 
Checking for function epoll_ctl          : yes 
Checking for header port.h               : not found 
Checking for header poll.h               : yes 
Checking for function poll               : yes 
Checking for header ['sys/types.h', 'sys/event.h'] : not found 
Checking for header sys/queue.h                    : yes 
Checking for function kqueue                       : not found 
Checking for header sys/select.h                   : yes 
Checking for function select                       : yes 
Checking for header sys/eventfd.h                  : not found 
Checking for SYS_clock_gettime                     : yes 
Checking for library rt                            : yes 
Checking for function clock_gettime                : yes 
Checking for function nanosleep                    : yes 
Checking for function ceil                         : yes 
Checking for fdatasync(2) with c++                 : yes 
'configure' finished successfully (5.075s)
-jailshell-3.00$ make && make install
Waf: Entering directory `/home/sparrow/bin/git/node-v0.4.12/build'
DEST_OS: linux
DEST_CPU: x64
Parallel Jobs: 1
Product type: program
[49/75] copy: src/node_config.h.in -> build/default/src/node_config.h
[50/75] copy: tools/nodejs.pc.in -> build/default/tools/nodejs.pc
[51/75] libv8.a: deps/v8/SConstruct -> build/default/libv8.a
/usr/local/bin/python "/home/sparrow/bin/git/node-v0.4.12/tools/scons/scons.py" -j 1 -C "/home/sparrow/bin/git/node-v0.4.12/build/default/" -Y "/home/sparrow/bin/git/node-v0.4.12/deps/v8" visibility=default mode=release arch=x64 toolchain=gcc library=static snapshot=on
scons: Reading SConscript files ...

scons: warning: Ignoring missing SConscript 'obj/test/release/SConscript'
File "/home/sparrow/bin/git/node-v0.4.12/deps/v8/SConstruct", line 1201, in BuildSpecific
scons: done reading SConscript files.
scons: Building targets ...
g++ -o obj/release/platform-linux.o -c -Wall -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m64 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-rtti -fno-exceptions -Wall -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -m64 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -DV8_TARGET_ARCH_X64 -DENABLE_VMSTATE_TRACKING -DENABLE_LOGGING_AND_PROFILING -DENABLE_DEBUGGER_SUPPORT -I/home/sparrow/bin/git/node-v0.4.12/deps/v8/src /home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc: In function `void* v8::internal::ThreadEntry(void*)':
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: error: `PR_SET_NAME' was not declared in this scope
/home/sparrow/bin/git/node-v0.4.12/deps/v8/src/platform-linux.cc:587: warning: unused variable 'PR_SET_NAME'
scons: *** [obj/release/platform-linux.o] Error 1
scons: building terminated because of errors.
Waf: Leaving directory `/home/sparrow/bin/git/node-v0.4.12/build'
Build failed:  -> task failed (err #2): 
        {task: libv8.a SConstruct -> libv8.a}
make: *** [program] Error 1
-jailshell-3.00$ 

Node.js需要根访问权限,而共享服务器通常不提供此权限。请与主机联系,检查节点命令是否有效。顺便说一下,从jailshell切换到普通shell是节点的先决条件

您仍然可以执行以下步骤:

使用SSH登录您的帐户(如果您的帐户未启用SSH,请与我们的支持人员联系)

在命令提示下,键入下一步命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version
上面的命令将下载v6.9.1版本,如果您需要不同的版本,可以在此处找到最新版本:

要提取Node.js文件,请键入以下命令:

tar xvf node-v6.9.1-linux-x64.tar.xz
mv node-v6.9.1-linux-x64 nodejs
现在,我们将文件夹重命名为nodejs name,要执行此操作,请使用以下命令:

tar xvf node-v6.9.1-linux-x64.tar.xz
mv node-v6.9.1-linux-x64 nodejs
现在安装node和npm二进制文件,键入以下命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version
也就是说,Node.js和npm都安装在您的帐户上。要进行验证,请键入以下命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version

Node.js需要根访问权限,而共享服务器通常不提供此权限。请与主机联系,检查节点命令是否有效。顺便说一下,从jailshell切换到普通shell是节点的先决条件

您仍然可以执行以下步骤:

使用SSH登录您的帐户(如果您的帐户未启用SSH,请与我们的支持人员联系)

在命令提示下,键入下一步命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version
上面的命令将下载v6.9.1版本,如果您需要不同的版本,可以在此处找到最新版本:

要提取Node.js文件,请键入以下命令:

tar xvf node-v6.9.1-linux-x64.tar.xz
mv node-v6.9.1-linux-x64 nodejs
现在,我们将文件夹重命名为nodejs name,要执行此操作,请使用以下命令:

tar xvf node-v6.9.1-linux-x64.tar.xz
mv node-v6.9.1-linux-x64 nodejs
现在安装node和npm二进制文件,键入以下命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version
也就是说,Node.js和npm都安装在您的帐户上。要进行验证,请键入以下命令:

cd ~
wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.xz
mkdir ~/bin
cp nodejs/bin/node ~/bin
cd ~/bin
ln -s ../nodejs/lib/node_modules/npm/bin/npm-cli.js npm
node --version
npm --version

一个快速的谷歌搜索出现了。这对你有帮助吗?谢谢你的链接,我试着用
PR\u SET\u NAME
注释掉这些行,但还是出错了。这不是我的答案。快去谷歌搜索吧。这对你有帮助吗?谢谢你的链接,我试着用
PR\u SET\u NAME
注释掉这些行,但还是出错了。这不是我的答案。看看