EXCLUDE_GLOBS causes failure for directory with a git submodule

Open
#272 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, javascript, node.js
Domain
build-system, cli

Research direction

Start by reproducing the failure with node-lambda package, a local file:sub-module dependency, and EXCLUDE_GLOBS="sub-module". Inspect the packaging flow around lib/main.js:543 and how EXCLUDE_GLOBS handles submodule directories. Done means the directory can be excluded without npm install failing, while the workaround does not leave sub-module/package.json in the archive.

Written by the indexing model from the issue text.

Description

bug

If a git submodule is listed in package.json

  "dependencies": {
  ....
    "sub-module": "file:sub-module"
  },

and the directory name is within EXCLUDE_GLOBS
EXCLUDE_GLOBS="sub-module"
the following error occurs.

As a workaround, one can exclude the directory content EXCLUDE_GLOBS="sub-module/*", but this leaves sub-module/package.json in the zip file.

$ node-lambda package
Warning!!! You are building on a platform that is not 64-bit Linux (darwin.x64). If any of your Node dependencies include C-extensions, they may not work as expected in the Lambda environment.


=> Moving files to temporary directory
=> Running npm install --production
/usr/local/lib/node_modules/node-lambda/lib/main.js:543
      throw err;
      ^

Error: Command failed: npm -s install --production --prefix /var/folders/4c/b2p9cxl9699211w4mps998g40000gp/T/apiAccess-1494407987225

    at ChildProcess.exithandler (child_process.js:204:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:886:16)
    at Socket.<anonymous> (internal/child_process.js:342:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:501:12)
$ 
Dominant language
JavaScript
Stars
1.4k
Forks
185
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from motdotla/node-lambda

All issues in motdotla/node-lambda

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.