Skip to content
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

Local dependencies are not included in final zip file #434

Open
vladaman opened this issue May 28, 2018 · 3 comments
Open

Local dependencies are not included in final zip file #434

vladaman opened this issue May 28, 2018 · 3 comments

Comments

@vladaman
Copy link

I might having which may be related to previous issue

Node version : 10.2.1
NPM version : 6.1.0
Node-lambda version : 0.11.7

When we use local dependencies they are not included in final package. Symlink crreated in .lambda folder is invalid. Relative path is invalid. It may be due to changes in npm which include relative and not absolute path in package.json

@DeviaVir DeviaVir added the bug label May 29, 2018
@abetomo
Copy link
Contributor

abetomo commented May 30, 2018

@vladaman Could you try the --prebuiltDirectory option?

#354 (comment)

@vladaman
Copy link
Author

No, it did not help. I get another error with --prebuildDirectory

Problem may be, that my local modules in node_modules are simlinks. So they cannot be copied.

Error: Source and destination must not be the same.
    at checkStats (/usr/lib/node_modules/node-lambda/node_modules/fs-extra/lib/copy/copy.js:237:17)
    at fs.stat (/usr/lib/node_modules/node-lambda/node_modules/fs-extra/lib/copy/copy.js:227:14)
    at /usr/lib/node_modules/node-lambda/node_modules/graceful-fs/polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:153:5)

@vladaman
Copy link
Author

vladaman commented May 10, 2019

So I am not having any luck fixing this. How I setup my project is that I got local dependencies in ../local_modules - they are linked in packages.json using "file:../local_modules/someModule"

When I package with node-lambda the final .zip file contains symkink to ../local_modules and not actual files. Running this on AWS will fail due to missing files.

I tried numerous packing options such as fixing archiver, packaging with install_local - none of them seems to support having "shared" local modules.

[edit] Solution I found is zip it with:

zip -r out.zip ./
node-lambda deploy -z out.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants