Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps - Status | Demo | Docs | Install
  1. Cloudron Forum
  2. LAMP
  3. NPM clean-install in public folder - command not found

NPM clean-install in public folder - command not found

Scheduled Pinned Locked Moved LAMP
5 Posts 2 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    ccfu
    wrote on last edited by ccfu
    #1

    As I understand it npm should be installed and usuable in the LAMP app, bit every time i try to execute the command

    npm clean-install
    

    as the www-data user in the public directory I get the error npm: command not found. I've seen a few tips here in the forum relating to problems with npm but nothing that solves this.

    1 Reply Last reply
    0
    • murgeroM Offline
      murgeroM Offline
      murgero
      App Dev
      wrote on last edited by murgero
      #2

      Use the full path to it as it is probably just not in the $PATH var for www-data:

      /usr/local/node-18.18.0/bin/npm <args>

      --
      https://urgero.org
      ~ Professional Nerd. Freelance Programmer. ~

      C 1 Reply Last reply
      0
      • murgeroM murgero

        Use the full path to it as it is probably just not in the $PATH var for www-data:

        /usr/local/node-18.18.0/bin/npm <args>

        C Offline
        C Offline
        ccfu
        wrote on last edited by
        #3

        @murgero Thank you. Unfortunately it still doesn't work. Now getting

        /usr/bin/env: ‘node’: No such file or directory
        

        as a response.

        murgeroM 1 Reply Last reply
        0
        • C ccfu

          @murgero Thank you. Unfortunately it still doesn't work. Now getting

          /usr/bin/env: ‘node’: No such file or directory
          

          as a response.

          murgeroM Offline
          murgeroM Offline
          murgero
          App Dev
          wrote on last edited by murgero
          #4

          @ccfu oh ok so node is also not in the path for www-data. Try this instead:

          • Add the Node binaries to PATH:

            • Run command: PATH=$PATH:/usr/local/node-18.18.0/bin/
          • Now run npm or node:

            • Run command: npm clean-install

          Note - you will need to run that PATH command everytime you reset the www-data session (so whenever you login/logout to the terminal or via ssh / etc)

          --
          https://urgero.org
          ~ Professional Nerd. Freelance Programmer. ~

          C 1 Reply Last reply
          0
          • murgeroM murgero

            @ccfu oh ok so node is also not in the path for www-data. Try this instead:

            • Add the Node binaries to PATH:

              • Run command: PATH=$PATH:/usr/local/node-18.18.0/bin/
            • Now run npm or node:

              • Run command: npm clean-install

            Note - you will need to run that PATH command everytime you reset the www-data session (so whenever you login/logout to the terminal or via ssh / etc)

            C Offline
            C Offline
            ccfu
            wrote on last edited by
            #5

            @murgero Many thanks for your help.

            1 Reply Last reply
            1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Bookmarks
            • Search