Node.JS/NPM Installation on Plesk 17

泄露秘密 提交于 2020-07-10 07:27:29

问题


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/

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.

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

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

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?


回答1:


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

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

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


来源:https://stackoverflow.com/questions/49489438/node-js-npm-installation-on-plesk-17

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!