serverless / serverless/serverless

Deploying requires inexistent packages

Open
#6,180 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug cat/packaging
Dominant language
JavaScript
Stars
46.9k
Forks
5.7k
Avg merge
10h 7m
Merged PRs (30d)
57

Description

This is a Bug Report

Description

  • What went wrong?
    I was developing with serverless-appsync-plugin along with a few lambda, after a few runs of sls deploy it suddenly prompts for missing modules in the node_modules/.bin directory.

    First it wants node-gyp, I manually installed that as a workaround, it then asks for node-ninja. I suspect there is a list of missing internal dependencies from serverless-cli because of some misconfiguration I made in the way.

    I recently updated serverless with sudo npm up -g serverless, not sure if that introduces the error.

  • What did you expect should have happened?
    My application should deploy normally like before.

  • What was the config you used?

    # Welcome to serverless. Read the docs
    # https://serverless.com/framework/docs/
    
    # Serverless.yml is the configuration the CLI
    # uses to deploy your code to your provider of choice
    # https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/#serverlessyml-reference
    
    # The `service` block is the name of the service
    service: test-api
    
    # The `provider` block defines where your service will be deployed
    provider:
      name: aws
      runtime: nodejs10.x
      stackName: test-api
      deployementPrefix: test
      tracing:
        lambda: true
    
    plugins:
      - serverless-plugin-typescript
    
    functions:
      test:
        handler: lambda/test.handler
        description: Test function that dumps it's input.
    
  • What stacktrace or error message from your provider did you see?

    Error: ENOENT: no such file or directory, open '/Users/[REDACTED]/.build/node_modules/.bin/node-ninja'
        at Package.getFileContent (/usr/local/lib/node_modules/serverless/lib/plugins/package/lib/zipService.js:130:15)
        at Package.getFileContentAndStat (/usr/local/lib/node_modules/serverless/lib/plugins/package/lib/zipService.js:119:12)
        at Array.map (<anonymous>)
        at WriteStream.output.on (/usr/local/lib/node_modules/serverless/lib/plugins/package/lib/zipService.js:91:29)
        at WriteStream.emit (events.js:189:13)
        at WriteStream.EventEmitter.emit (domain.js:441:20)
        at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:231:14
        at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:258:16
        at FSReqWrap.args [as oncomplete] (fs.js:140:20)
    

Additional Data

  • Serverless Framework Version you're using: 1.43.0
  • Operating System: darwin
  • Stack Trace:
  • Provider Error messages: ENOENT: no such file or directory, open '/Users/Vicary/[REDACTED]/.build/node_modules/.bin/node-gyp'

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with serverless/lib/plugins/package/lib/zipService.js, especially the paths around lines 91-130 shown in the stack trace, and reproduce the deployment using the supplied serverless.yml and Serverless Framework 1.43.0 configuration. Trace why node_modules/.bin/node-gyp or node-ninja is included in the package file list but missing from .build. Done means the deployment no longer fails with the reported ENOENT error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript, node.js
Domain
build-system, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.