Strangely, NPM overwrites the TMPDIR environment variable (and therefore the result of os.tmpDir()) to the current working directory. This means when running node-lambda deploy as a NPM script in package.json, it fails on the rsync step as the destination directory exists in the folder you're synchronising (causing heaps of file has vanished: type errors).
I can fix this by explicitly setting the TMPDIR variable as I deploy, something like:
"scripts": {
"deploy-stage": "TMPDIR=/tmp node-lambda deploy"
}
Strangely, NPM overwrites the
TMPDIRenvironment variable (and therefore the result ofos.tmpDir()) to the current working directory. This means when runningnode-lambda deployas a NPM script inpackage.json, it fails on thersyncstep as the destination directory exists in the folder you're synchronising (causing heaps offile has vanished:type errors).I can fix this by explicitly setting the
TMPDIRvariable as I deploy, something like: