-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-gyp requires home to specified by environment variables #18
Comments
@rmg , I'd think upstart would set this, but maybe we need to set ourselves? @ lee, did you use pm-install to install? OS distribution and upstart version? |
@sam-github we already explicitly set it in the Upstart job for this very reason. |
Hm... Lee, did you write a systemd job yourself? Or you own job? How are you arranging to start strong-pm? |
@sam-github I'm using a systemd job created as a result of https://groups.google.com/forum/#!topic/strongloop/4iNqnrcM6nA [Unit]
Description=Strongloop Process Manager - Ibcos API Server - Production
After=network.target
[Service]
ExecStart=/usr/local/bin/slc pm -l 7779 -b /home/dev/strong-pm/ibcos-api-server-production
Restart=always
[Install]
WantedBy=multi-user.target |
@lsdriscoll, OK, so setting HOME in your systemd job will fix this. @rmg opinion on whether strong-pm should set HOME/the-windows-equivalent to it's CWD or it's BASE if it finds it not set? Given that its not clear what HOME should be if its not set, I'm not sure it should make a choice. |
@lsdriscoll sorry I didn't notice the missing $HOME at the time. Assuming [Unit]
Description=Strongloop Process Manager - Ibcos API Server - Production
After=network.target
[Service]
ExecStart=/usr/local/bin/slc pm -l 7779 -b /home/dev/strong-pm/ibcos-api-server-production
Restart=always
User=dev
Environment=HOME=/home/dev
[Install]
WantedBy=multi-user.target |
@sam-github node-gyp only needs it to store downloaded headers to build against (which I think is actually unnecessary: nodejs/node-gyp#492). Come to think of it, I'm not sure where npm is storing its cache if $HOME isn't set. We could look up the HOME of the uid being run under as a fallback (on OS X and Linux, at least). Does it seem likely that a user would intentionally unset $HOME? |
@lsdriscoll can you confirm the systemd fix works for you and we'll close issue? When we support systemd, we'll make sure this works out of the box. |
@sam-github That works perfectly 👍 |
From Lee Driscoll:
When deploying through strong-pm, the npm rebuild phase returns the following error:
Error: node-gyp requires that the user's home directory is specified in either of the environmental variables HOME or USERPROFILE
Googling that message shows people having this problem across various systems and fixing it by setting $HOME explicitly at the start of their script.
Using the .env file doesn't work I believe as that isn't read until the "start" phase
The text was updated successfully, but these errors were encountered: