我一直在网上寻找在我的plesk服务器上安装node-sass的解决方案。我读到这是一种拒绝,因为这不应该在生产服务器上完成(没关系-不是实时站点)。
我已经通过bitbucket上传了文档,并单击了NPM安装按钮。结果是下面的失败:
3822 verbose stack Error: node-sass@4.12.0 install: `node scripts/install.js`
3822 verbose stack spawn ENOENT
3822 verbose stack at ChildProcess.<anonymous> (/opt/plesk/node/9/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
3822 verbose stack at ChildProcess.emit (events.js:180:13)
3822 verbose stack at maybeClose (internal/child_process.js:936:16)
3822 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
3823 verbose pkgid node-sass@4.12.0
3824 verbose cwd /var/www/vhosts/mjmnagy.info/app
3825 verbose Linux 3.10.0-862.9.1.el7.x86_64
3826 verbose argv "/opt/plesk/node/9/bin/node" "/opt/plesk/node/9/bin/npm" "install"
3827 verbose node v9.10.1
3828 verbose npm v5.6.0
3829 error file sh
3830 error code ELIFECYCLE
3831 error errno ENOENT
3832 error syscall spawn
3833 error node-sass@4.12.0 install: `node scripts/install.js`
3833 error spawn ENOENT
3834 error Failed at the node-sass@4.12.0 install script.
3834 error This is probably not a problem with npm. There is likely additional logging output above.
3835 verbose exit [ 1, true ]我试图使用SSH登录服务器,但我终生都不知道如何安装它。
使用SSH,我导航到节点安装位置(/opt/plesk/node/7/bin/),尝试6/7/8,然后运行npm。我总是得到无法识别的命令。
然后我意识到我拥有的node-sass版本比服务器上安装的node版本(9.10.1)要高
我需要做什么才能安装模块?
发布于 2019-05-23 07:21:59
忽略plesks NPM安装按钮并在你的package.json中创建一个脚本
"installme": "npm i --unsafe-perms"
使用plesk运行脚本
installme --scripts-node-prepend-path
https://stackoverflow.com/questions/56265869
复制相似问题