错误!代码 ELIFECYCLE,errno ENOENT & 系统调用 spawn

npm ERR! code ELIFECYCLE,errno ENOENT & syscall spawn

我在专用 CentOs7 的子域文件夹下 运行ning npm 命令 linux server.but "npm install" 命令会出现一些错误,例如:

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

如果删除 fibers 依赖项,则 core-js 包会出现相同的错误。

然后在 "npm run dev" 命令中我有这个

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! myappname@1.0.0 dev: `nuxt`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the myappname@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我没有 root 用户权限,我 运行 ssh 命令和 plesk 在不同的节点版本中提供了选项,我在所有版本中都遇到了同样的问题:

/opt/plesk/node/9/bin/npm install
/opt/plesk/node/10/bin/npm install
/opt/plesk/node/12/bin/npm install

如有任何帮助,我们将不胜感激。

在更专注于错误之后,我找到了解决方案。

像'fibers'这样的软件包需要在OS上安装编译器,在我的例子中,GCC(C/C++ Linux的编译器)是解决方案.

sudo yum groupinstall "Development Tools" 命令帮我完成了。