On October 19, 2021, we have enabled single-sign-on for our Plesk Support Center to provide a seamless login/account experience. This implies that you’ll be able to use a single account across any of our web-facing properties.
If you had already registered your account at Plesk 360 (formerly known as My Plesk) please use one for login. Otherwise please re-register it using the same email address as your existing Zendesk login (support account). It’s essential that you use the same email address on our support center to ensure that your tickets stay attached to the same account.

Unable to use NPM install for Node.js application in Plesk: usr/bin/env: ‘node’: No such file or directory

Follow

Comments

3 comments

  • Avatar
    Henry C. Lavau (Edited )

    find /opt/plesk/node/12 -type f -print0 | xargs -0 sed -i -e '1s,#!/usr/bin/env node,#!${2}/bin/node,g' -e '1s,^#!\s*/usr/bin/python($|\s),#!/usr/bin/python2\1,' -e '1s,^#!\s*/usr/bin/env\s+python($|\s),#!/usr/bin/env python2\1,'

    =>
    sed: -e expression #2, char 52: invalid reference \1 on `s' command's RHS
    sed: -e expression #2, char 52: invalid reference \1 on `s' command's RHS
    sed: -e expression #2, char 52: invalid reference \1 on `s' command's RHS

    What would be the correct command?

    0
    Comment actions Permalink
  • Avatar
    Yaroslav Tarasov

    @Henry C. Lavau try to edit the file /opt/plesk/node/12/lib/node_modules/npm/bin/npm-cli.js manually.
    The file starts with:

    #!/opt/plesk/node/12/bin/node
    ;(function () { // wrapper in case we're in module_context mode
    // windows: running "npm blah" in this folder will invoke WSH, not node.
    /* global WScript */
    if (typeof WScript !== 'undefined') {
    WScript.echo(
    'npm does not work when run\n' +
    'with the Windows Scripting Host\n\n' +
    "'cd' to a different directory,\n" +
    "or type 'npm.cmd <args>',\n" +
    "or type 'node npm <args>'."
    )
    WScript.quit(1)
    return
    }

    0
    Comment actions Permalink
  • Avatar
    Henry C. Lavau

    Thank you for your answer. I overcame the problem of installation I had for a package by installing Node 14.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request