question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Serverless + NodeJS v8.0 = error on sls deploy

See original GitHub issue

This is a Bug Report

Description

For bug reports:

  • What went wrong? when running sls deploywhen you have nodejs v8.0 you will get an error on package. You can see the error below.
  • What did you expect should have happened? The deploy successfully completed
  • What was the config you used? I used the sample nodejs project.
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
#    docs.serverless.com
#
# Happy Coding!

service: testing

# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"

provider:
  name: aws
  runtime: nodejs6.10

# you can overwrite defaults here
#  stage: dev
#  region: us-east-1

# you can add statements to the Lambda function's IAM Role here
#  iamRoleStatements:
#    - Effect: "Allow"
#      Action:
#        - "s3:ListBucket"
#      Resource: { "Fn::Join" : ["", ["arn:aws:s3:::", { "Ref" : "ServerlessDeploymentBucket" } ] ]  }
#    - Effect: "Allow"
#      Action:
#        - "s3:PutObject"
#      Resource:
#        Fn::Join:
#          - ""
#          - - "arn:aws:s3:::"
#            - "Ref" : "ServerlessDeploymentBucket"
#            - "/*"

# you can define service wide environment variables here
#  environment:
#    variable1: value1

# you can add packaging information here
#package:
#  include:
#    - include-me.js
#    - include-me-dir/**
#  exclude:
#    - exclude-me.js
#    - exclude-me-dir/**

functions:
  hello:
    handler: handler.hello

#    The following are a few example events you can configure
#    NOTE: Please make sure to change your handler code to work with those events
#    Check the event documentation for details
#    events:
#      - http:
#          path: users/create
#          method: get
#      - s3: ${env:BUCKET}
#      - schedule: rate(10 minutes)
#      - sns: greeter-topic
#      - stream: arn:aws:dynamodb:region:XXXXXX:table/foo/stream/1970-01-01T00:00:00.000
#      - alexaSkill
#      - iot:
#          sql: "SELECT * FROM 'some_topic'"
#      - cloudwatchEvent:
#          event:
#            source:
#              - "aws.ec2"
#            detail-type:
#              - "EC2 Instance State-change Notification"
#            detail:
#              state:
#                - pending
#      - cloudwatchLog: '/aws/lambda/hello'

#    Define function environment variables here
#    environment:
#      variable2: value2

# you can add CloudFormation resource templates here
#resources:
#  Resources:
#    NewResource:
#      Type: AWS::S3::Bucket
#      Properties:
#        BucketName: my-new-bucket
#  Outputs:
#     NewOutput:
#       Description: "Description for the output"
#       Value: "Some output value"
  • What stacktrace or error message from your provider did you see?
_stream_readable.js:545
  switch (state.pipesCount) {
               ^

TypeError: Cannot read property 'pipesCount' of undefined
    at module.exports.Readable.pipe (_stream_readable.js:545:16)
    at module.exports.ZipArchiveOutputStream._smartStream (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/zip/zip
-archive-output-stream.js:184:11)
    at module.exports.ZipArchiveOutputStream._appendBuffer (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/zip/zi
p-archive-output-stream.js:82:10)
    at module.exports.ArchiveOutputStream.entry (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/archive-output-st
ream.js:86:10)
    at module.exports.ZipStream.entry (/usr/local/lib/node_modules/serverless/node_modules/zip-stream/index.js:138:49)
    at Zip.append (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/plugins/zip.js:53:15)
    at Archiver._moduleAppend (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/core.js:172:16)
    at Archiver._onQueueTask (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/core.js:370:8)
    at /usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:4045:9
    at process (/usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:2316:17)
    at Immediate._onImmediate (/usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:66:16)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)

Additional Data

  • Serverless Framework Version you’re using: 1.14.0
  • Operating System: Mac OS X
  • Stack Trace:
_stream_readable.js:545
  switch (state.pipesCount) {
               ^

TypeError: Cannot read property 'pipesCount' of undefined
    at module.exports.Readable.pipe (_stream_readable.js:545:16)
    at module.exports.ZipArchiveOutputStream._smartStream (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/zip/zip
-archive-output-stream.js:184:11)
    at module.exports.ZipArchiveOutputStream._appendBuffer (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/zip/zi
p-archive-output-stream.js:82:10)
    at module.exports.ArchiveOutputStream.entry (/usr/local/lib/node_modules/serverless/node_modules/compress-commons/lib/archivers/archive-output-st
ream.js:86:10)
    at module.exports.ZipStream.entry (/usr/local/lib/node_modules/serverless/node_modules/zip-stream/index.js:138:49)
    at Zip.append (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/plugins/zip.js:53:15)
    at Archiver._moduleAppend (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/core.js:172:16)
    at Archiver._onQueueTask (/usr/local/lib/node_modules/serverless/node_modules/archiver/lib/core.js:370:8)
    at /usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:4045:9
    at process (/usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:2316:17)
    at Immediate._onImmediate (/usr/local/lib/node_modules/serverless/node_modules/archiver/node_modules/async/dist/async.js:66:16)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
  • Provider Error messages: TypeError: Cannot read property ‘pipesCount’ of undefined

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:22
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

12reactions
ryanmurakamicommented, Jun 10, 2017

Looks like this was fixed with v8.1.0. I was able to verify it with that version, so this issue can probably be closed now.

9reactions
pmuenscommented, Jun 2, 2017

Thanks for reporting @Tazer 👍

Seems like the node-archiver package has some problems with the changes in Node v8 (see: https://github.com/archiverjs/node-archiver/issues/236).

We should update this dependency as soon as an update is available.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Serverless deploy issue
I m using serverless 1.36.3, node js - v8.11.3 , npm -5.6.0 and windows 10 64 bit When I am deploying lambda code...
Read more >
Top 10 Serverless Deployment Errors (and How to Fix Them)
Top 10 Serverless Deployment Errors (and How to Fix Them) · 1. Invalid CloudFormation state · 2. Unable to fetch parameters · 3....
Read more >
How can I get serverless-webpack to work with babel.v8 to ...
How can I get serverless-webpack to work with babel.v8 to solve - Error: Plugin/Preset files are not allowed to export objects, only functions?...
Read more >
AWS Serverless Development: Coding Best Practices
What is NodeJs? Here's a formal definition as given on the official Node.js website: Node.js is a JavaScript runtime built on Chrome's V8...
Read more >
serverless | Yarn - Package Manager
serverless. owner serverless5.1mMIT3.26.0DT. Serverless Framework - Build web, mobile ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found