Skip to content

Commit 8783620

Browse files
authored
Fix #134 (#145)
1 parent c315f32 commit 8783620

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ The `--prebuiltDirectory` flag is useful for working with Webpack for example. I
151151
## Handling `npm link` and Dependencies With Local Paths
152152
Perhaps the easiest way to handle these cases is to bundle the code using Webpack and use the `--prebuiltDirectory` flag to package the output for deployment.
153153

154+
## Running `node-lambda` as an NPM script
155+
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).
156+
157+
You can resolve this by explicitly setting the `TMPDIR` variable as you deploy, something like:
158+
```
159+
"scripts": {
160+
"deploy-stage": "TMPDIR=/tmp node-lambda deploy"
161+
}
162+
```
163+
154164
## Other AWS Lambda Tools Projects
155165

156166
+ [lambdaws](https://github.com/mentum/lambdaws)

0 commit comments

Comments
 (0)