Plesk 17 上的 Node.JS/NPM 安装 [英] Node.JS/NPM Installation on Plesk 17

查看:77
本文介绍了Plesk 17 上的 Node.JS/NPM 安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了 Plesk Onyx 上 Node.js 的安装手册,并为我的域激活了 node.js.但我只能重新启动应用程序或禁用 Node.js.
https://docs.plesk.com/en-US/onyx/customer-guide/nodejs-support.76652/

I have followed following Installation manual for Node.js on Plesk Onyx and activated node.js for my domain. But I am only able to RestartApp or Disable Node.js.
https://docs.plesk.com/en-US/onyx/customer-guide/nodejs-support.76652/

现在有人要求我提供我的应用程序启动文件...好吧,我还没有 Node.js 应用程序,这就是我首先安装它以制作一个的原因.

Now I am beeing asked for my Application Startup File... Well I do not have a Node.js application yet thats why I installed it in the first place in order to make one.

我也无法安装 NPM,因为……我没有应用程序……

I cant install NPM either because well... I dont have a Application...

即使使用 SSH 登录并使用node -v",我也会收到一条错误消息,提示-bash: node: command not found".

Even when login in with SSH and using "node -v" I will just get a error saying "-bash: node: command not found".

如果 Node.js 明显没有正确安装 Node.js 或者让我安装像 NPM 这样的包管理器,我怎么能在 Plesk 上使用 Node.js 进行开发?

So how am I supossed to develop with Node.js on Plesk if it clearly does not install Node.js properly or let me install a package manager like NPM?

推荐答案

一旦package.json<在应用程序根目录中创建/a> 文件,将出现 NPM 安装运行脚本 按钮,允许安装指定的包或执行预定义的安装脚本.请参阅此页面以了解有关它的总体思路 - https://docs.npmjs.com/getting-started/using-a-package.json

Once the package.json file created in the application root directory, NPM install and Run script buttons will appear, allowing to install specified packages or execute the predefined installation script. Refer to this page to get the general idea regarding it - https://docs.npmjs.com/getting-started/using-a-package.json

Plesk 提供的 node.js 可执行文件可以在 /opt/plesk/node//bin/ 中找到.例如:

The executables for node.js provided by Plesk can be found in /opt/plesk/node/<version>/bin/. For example:

# /opt/plesk/node/6/bin/node -v
v6.12.2
# /opt/plesk/node/6/bin/npm -v
3.10.10

您可以将其添加到 PATH 变量中以运行它,而无需指定完整路径:

You can add it to PATH variable to run it without specifying the full path:

# export PATH=/opt/plesk/node/6/bin:$PATH
# echo "export PATH=/opt/plesk/node/6/bin:$PATH" >> ~/.bashrc
# node -v
v6.12.2

这篇关于Plesk 17 上的 Node.JS/NPM 安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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