在 plesk 上安装 node-sass [英] Install node-sass on plesk

查看:79
本文介绍了在 plesk 上安装 node-sass的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在网上寻找在我的 plesk 服务器上安装 node-sass 的解决方案.我读到这是一种不,因为这不应该在生产服务器上完成(不在乎 - 不是实时站点).

Ive been looking online for a solution to installing node-sass on my plesk server. I read that this is kind of a no no as this should not be done on a production server(dont care - not a live site).

我已通过 bitbucket 上传文档并单击 NPM 安装按钮.结果是下面的失败:

I have uploaded the documents via bitbucket and click the NPM install button. The result is the failure below:

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 登录服务器,但我终生不知道如何安装它.

I attempted to login to the server using SSH but for the life of me couldn't figure out how to install it.

使用 SSH,我导航到节点的安装位置 (/opt/plesk/node/7/bin/),尝试 6/7/8 然后运行 ​​npm.我总是收到无法识别的命令.

Using SSH, i navigated to where node is install (/opt/plesk/node/7/bin/) trying 6/7/8 and then running npm. i always got unrecognized command.

然后我意识到我拥有的 node-sass 版本高于服务器上安装的 node 版本(9.10.1)

I then realized that the version i have of node-sass was higher than the node version install on the server(9.10.1)

我需要做什么才能安装模块?

What do i need to do to be able to install the module?

推荐答案

忽略 plesks NPM 安装按钮并在 package.json 中创建脚本

ignore plesks NPM install button and create a script in your package.json

"installme": "npm i --unsafe-perms"

使用 plesk 运行脚本

Using plesk run the script

installme --scripts-node-prepend-path

这篇关于在 plesk 上安装 node-sass的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆