NPM clean-install in public folder - command not found
-
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.
-
@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/
- Run command:
-
Now run npm or node:
- Run command:
npm clean-install
- Run command:
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)
-