How to install and run Node.js application in Plesk?

Comments

2 comments

  • Avatar
    Karl May

    The first line for CLI is wrong, because this version:
    export PATH=$PATH:/opt/plesk/node/18/bin
    shows with
    # which npm
    /usr/local/bin/npm

    So the line must be change to:
    export PATH=/opt/plesk/node/18/bin:$PATH
    because this adds the line to the beginning of PATH. Now:
    # which npm
    /opt/plesk/node/18/bin/npm

    0
  • Avatar
    Xyonet Hosting

    I had a nodejs/typescript/react app generated at bolt.new.  ensure that you're on a lts version of node/npm (even numbered versions are lts.) 

    application root was the root for the domain “/var/www/domain.name/httpdocs.”

    document root turned out to be the directory named “/var/www/domain.name/httpdocs/dist”

    application startup file was “src/main.tsx”

    then, as root, in the main folder, “npm install” then “npm build” then chown -R <the domain owner:psacln> * 

    in the node js dashboard don't enable nodejs.

    Thought this would help anyone having trouble. It took me a couple of weeks and probably  100 google searches to get this going.

     

    0

Please sign in to leave a comment.

Have more questions? Submit a request