Node.js Run Script option fails on Plesk server: no node binary in the current PATH

Follow

Comments

6 comments

  • Avatar
    Paolo Gabrielli (Edited )

    @... I don't have any npmrc file, and the "etc" directory doesn't exist. Do you want us to create it? Because if I create it, it seems to work.

    0
    Comment actions Permalink
  • Avatar
    Nelson Leiva

    Hi Paolo Gabrielli, Thank you for noticing that! The article was updated accordingly.

    0
    Comment actions Permalink
  • Avatar
    Sébastien Angot

    Hi

    When you say «Create the file nmprc file», in fact you mean the «nmprc» file, right?

    So I
    - created the «etc» folder
    - created the «npmrc» file inside
    - added the content «echo "scripts-prepend-node-path=true"» in the npmrc file

    And I still get the error

    npm WARN lifecycle npm is using /opt/plesk/node/12/bin/node but there is no node binary in the current PATH. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with.

    Any idea?

    0
    Comment actions Permalink
  • Avatar
    Sébastien Angot

    Ok I solved my issue by adding a .npmrc file in the App root with this content

    scripts-prepend-node-path=true

    and not in 

    opt/plesk/node/12/

     

    0
    Comment actions Permalink
  • Avatar
    Stefan Yakubov

    Hello, Sébastien Angot

     

    > - added the content «echo "scripts-prepend-node-path=true"» in the npmrc file

    echo was not needed in the file itself. The following command from the article creates appropriate file.

    # echo "scripts-prepend-node-path=true" >> /opt/plesk/node/12/etc/npmrc

    0
    Comment actions Permalink
  • Avatar
    Tibor Szentmarjay

    It was still not working for me so I added node and npm to the path and it worked:

    export PATH=$PATH:/opt/plesk/node/16/bin

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request