Bug 248877

Summary: www/npm: npm avtostart ?
Product: Ports & Packages Reporter: Aleks <Z462vasa>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Open ---    
Severity: Affects Only Me CC: saper
Priority: --- Flags: koobs: maintainer-feedback? (sunpoet)
Version: Latest   
Hardware: Any   
OS: Any   

Description Aleks 2020-08-24 11:25:30 UTC
npm avtostart  ?

did not find documentation how to make autostart 


 cd .. && npm install && npm start

FreeBSD 12.1-STABLE r362880 GENERIC  amd64


npm_enable="yes" ????
Comment 1 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-09-12 12:16:36 UTC
I don't understand what it means.
Comment 2 Aleks 2020-09-15 09:12:28 UTC
Good afternoon ! I run with pens.

cd .. && npm install && npm start

I wanted to run it myself.

After starting the server
Comment 3 Marcin Cieślak 2023-09-25 10:58:52 UTC
Here is what you can do:

- let's assume your project is in /home/project directory
- you need to run "npm install" only once:


  (cd /home/project && npm install)

- probably you want to run your project as some user (say "myuser") and not root.

- after this you can add the following to the /etc/rc.local file:

  (cd /home/project && su myuser -c "npm start")

hope this helps!