无法在Vpan Nuxt应用程序的cpanel服务器上安装Npm吗?

时间:2020-07-20 15:27:25

标签: node.js npm cpanel nuxt.js fibers

我正在尝试在项目的cpanel终端中运行npm install,但是它给了我错误。

首先,当您使用接口创建节点应用程序时,我按照cpanel的描述在cpanel终端中输入虚拟环境。我写命令“ source /home/mywebhotel/nodevenv/mydomain.com/10/bin/activate && cd /home/mywebhotel/mydomain.com”

然后我检查该节点是否已安装。

我已经为Vue / Nuxt应用程序添加了package.json文件,然后运行npm install,它为我提供了以下内容:

> fibers@4.0.3 install /home/mywebhotel/nodevenv/mydomain.com/10/lib/node_modules/fibers
> node build.js || nodejs build.js
`linux-x64-64-glibc` exists; testing
Problem with the binary; manual build incoming
make: Entering directory `/home/mywebhotel/nodevenv/mydomain.com/10/lib/node_modules/fibers/build'
  CXX(target) Release/obj.target/fibers/src/fibers.o
make: execvp: g++: Permission denied
make: *** [Release/obj.target/fibers/src/fibers.o] Error 127
make: Leaving directory `/home/mywebhotel/nodevenv/mydomain.com/10/lib/node_modules/fibers/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/lib/build.js:191:23)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 3.10.0-962.3.2.lve1.5.35.el7.x86_64
gyp ERR! command "/opt/alt/alt-nodejs10/root/usr/bin/node" "/opt/alt/alt-nodejs10/root/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/mywebhotel/nodevenv/mydomain.com/10/lib/node_modules/fibers
gyp ERR! node -v v10.20.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
RHEL users please run: `yum install gcc-c++` and `yum groupinstall 'Development Tools'`
Alpine users please run: `sudo apk add python make g++`
sh: nodejs: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/watchpack-chokidar2/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@babel/cli/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/nodemon/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN babel-eslint@10.1.0 requires a peer of eslint@>= 4.12.1 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fibers@4.0.3 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fibers@4.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/mywebhotel/.npm/_logs/2020-07-20T14_32_17_650Z-debug.log

如果我尝试编写sudo npm进行安装,它会指出:bash:sudo:找不到命令

我希望有人能提供帮助! :)

1 个答案:

答案 0 :(得分:0)

   npm install -g node-gyp
   npm install --production windows-build-tools
   export npm_config_node_gyp=/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js
   rm -rf node_modules(if already there)
   npm install

尝试上面的命令并检查它是否有效。