• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved npm not available

geehaa

Basic Pleskian
i need npm for my build/deploy scripts for my laravel mix deployment so i installed nodejs package as instructed on plesk website.

i enabled the module in the hosting settings for the subdomain.

now when i log in over ssh to the server and run my deploy script i still get:
The program 'npm' is currently not installed. To run 'npm' please ask your administrator to install the package 'npm'

how to fix this?
 
Hi geehaa,

did you see the very good article at


Installing the Plesk Node.js - support with the Plesk installer, will give you the option to use "npm" - commands over the command line with the paths:

Code:
/opt/plesk/node/6/bin/npm
and
Code:
/opt/plesk/node/7/bin/npm



If you experience issues/errors/problems, pls. always consider to post your used commands and the corresponding outputs from your command line, so people willing to help you have something to start with their investigations. The MORE informations you provide, the better will be possible solutions and work-arounds from The Plesk Community. :)
 
thanks for your response.

Yes indeed, that's the article i used to install node component but it doesnt mention where the binaries are installed for use with shell but that was not so hard to figure out.

I have it all working now.

crude and simple example post-deploy script that gets called from plesk git plugin after git hook for someone else who was looking for same solution:

Code:
#!/bin/bash

phpbin="/opt/plesk/php/7.1/bin/php" 
composerbin=$(which composer) 
npmbin="/opt/plesk/node/6/bin/npm" 

date=$(date +'%Y-%m-%d') 
branch="acceptance" 
domain="xxxxx.xxx.xx" 
logfile="/var/www/vhosts/xxxxxx.xxx/logs/${date}.${branch}.${domain}.log"

$phpbin $composerbin install --no-dev --optimize-autoloader >> $logfile 2>&1
.... do more stuff
$npmbin run prod >> $logfile 2>&1
 
Hey @UFHH01,

Thanks for your answer. I was wondering why `/opt/plesk/node/7/bin/npm install` works at all.

According to this article:
Using remote Git hosting

You should only have access to the httpdocs folder:

Note: On Linux, if SSH access is forbidden for the domain's system user, all specified commands will run in a chrooted environment. The home directory of the subscription's system user is treated as the file system root for that subscription, and no executable files outside the chroot jail can be run. For example, if the path to your site is /var/www/vhosts/example.com/httpdocs, in a chrooted environment, the path will be ./httpdocs, so you will not be able to execute commands outside one level above the /httpdocs directory.
 
Hi geehaa,

did you see the very good article at


Installing the Plesk Node.js - support with the Plesk installer, will give you the option to use "npm" - commands over the command line with the paths:

Code:
/opt/plesk/node/6/bin/npm
and
Code:
/opt/plesk/node/7/bin/npm



If you experience issues/errors/problems, pls. always consider to post your used commands and the corresponding outputs from your command line, so people willing to help you have something to start with their investigations. The MORE informations you provide, the better will be possible solutions and work-arounds from The Plesk Community. :)
you could do a symlink way like nano ~/.bashrc

alias npm='/opt/plesk/node/22/bin/npm'
 
Back
Top