Closed bgkittrell closed 8 years ago
hmm, good question. I'm definitely interested in the answer, @doowb any thoughts on this?
Maybe Lambdas don't have a home directory?
AFAIK, lambda is running a linux image but I don't know if there are restrictions on the home directory.
osenv
is using os-homedir
which is supposed to be a polyfill for older versions of node (which lambda used to only have node v0.10
available but now has node v4
.
I think osenv
is also used in npm
so it should be working in lambda.
I started a thread in the AWS forums. Hopefully they'll have some answers.
FYI, I just ran osenv.home() in a lambda and it returns null.
It looks like I might be able to fix this by setting the PREFIX environment variable. What should that value be?
I'm afraid I won't be much help on this one. I'm not familiar with ASW lambda at all. @doowb?
I'll try to see if I know anyone that might be able to look at this too
I was googling around and haven't really found anything useful about lambda and the file system.
You could set the PREFIX
environment variable to the npm path. You can find that by doing npm bin -g
then removing the bin
from the path.
I set the PREFIX env variable to /usr and that addressed the issue.
Thanks for your help.
I'm trying to run a sequelize migration from a Lambda and it's breaking when trying to get the global prefix. I believe it was working on version 0.1.2, but this new line that's been added in 0.1.3 is failing.
var userConfig = path.resolve(osenv.home(), '.npmrc');
Maybe Lambdas don't have a home directory? I'm having a hard time finding out. Any suggestions would be helpful. Attaching a screenshot of the trace.