agutoli / serverless-layers

Serverless.js plugin implementing AWS Lambda Layers, reducing lambda size, warm-up, and deployment time.
MIT License
229 stars 54 forks source link

Imposible to use with ci deployment #38

Closed shubham-prasad closed 4 years ago

shubham-prasad commented 4 years ago

Why and when?

  1. During a deployment to production, I use npm ci to install trusted versions of dependencies. The plugin, regardless, tries to install dependencies again, which install the latest version from package.json.
  2. When I tried using "customInstallationCommand" parameter, I got an error, npm ERR! cipm can only install packages with an existing package-lock.json or npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or later to generate it, then try again.

Possibly because of the fact that npm when being used programmatically is not reading lock file in the base folder automatically.

Possible solution:

shubham-prasad commented 4 years ago

I will try to implement this in my fork. Let me know this feature is useful enough to create a pull request.

agutoli commented 4 years ago

Hi @shubham-prasad . Are you using some private package? If yes, try the last version which I added .npmrc to be copied if that file exists.