在 Plesk Onyx 中安装其他节点版本 [英] Install additional node versions in Plesk Onyx
问题描述
这是一个指南,不是要解决的问题,可以帮助那些和我有同样问题的人
在 Plesk Onyx 中启用节点支持:
Enable Node support in Plesk Onyx:
- Install the "Node support" simply from your "update and updates" Plesk interface.
- Go to your "Node extension" page enable/disable the node versions you need
如果您需要默认节点支持安装中未附带的其他节点版本:
In case you need additional node versions which does not come with the default node support installation:
- 安装Node V版本Manager 在您的服务器上
- 安装您需要的版本,例如
nvm install v4.8.4
- 将节点版本复制粘贴到plesk
cp -R ~/.nvm/versions/node/v4.8.4//opt/plesk/node/
- 然后通知您的 plesk 关于您的安装
plesk sbin nodemng register/opt/plesk/node/v4.8.4/bin/node
- 转到列出所有节点版本的节点扩展页面,点击刷新并瞧
- Install the Node Version Manager on your server
- Install the versions you need e.g.
nvm install v4.8.4
- Copy paste the node version to plesk
cp -R ~/.nvm/versions/node/v4.8.4/ /opt/plesk/node/
- Then notify your plesk about your installation
plesk sbin nodemng register /opt/plesk/node/v4.8.4/bin/node
- Go to your node extension page where all node versions are listed, hit refresh and voilá
我在将其他节点版本安装到 Plesk 中以在我的服务器上运行我的meteorJS 应用程序而不是他们的托管服务时遇到了一些麻烦.
I had some troubles installing additional node versions into Plesk to run my meteorJS app on my server instead of their hosting service.
推荐答案
感谢提问 :)有些人在使用这种方法时,遇到了这个问题:
Thanks for the question :) As some people were using this method, they ran into this problem:
/opt/plesk/node/v12.13.1/bin/npm install
/usr/bin/env: 'node': No such file or directory
NPM 脚本通过请求 env
来寻找默认节点位置.NPM 文件的 plesk 版本稍作修改以指向正确的节点版本.
The NPM script is looking for the default node location by asking it to env
.
The plesk-version of the NPM files are slightly modified to point to the correct node version.
要解决此问题,请对 npm 文件进行小幅
To fix this, make a small edit to the npm file:
- 在第 3 步之后,编辑
/opt/plesk/node/[your_version]/bin/npm
文件. - 将第一行替换为
#!/opt/plesk/node/[your_version]/bin/node
这篇关于在 Plesk Onyx 中安装其他节点版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!