serverless: Serverless + NodeJS v8.0 = error on sls deploy
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
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 22
- Comments: 15 (7 by maintainers)
Commits related to this issue
- Update to Node 8.1 Version 8 is a bit buggy: https://github.com/serverless/serverless/issues/3723 — committed to verypossible/serverless by brianz 7 years ago
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.Thanks for reporting @Tazer 👍
Seems like the
node-archiverpackage 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.
Same here, looks like i’ll need to roll back to 6.10.3 for now. I need to get bash on ubuntu on windows 👍 installed so i can just nvm between projects . Love serverless, keep up the good work. 😃
Update: rollback to 6.10.3 works
Not super familiar with GitHub comments, sorry if this opens this issue again, but here’s the suuuper quick fix:
brew upgrade nodeor using
nvm:nvm install v7.9.0 && nvm alias default v7.9.0Or, for homebrew, if you had a version 7 installed:
brew list --versions nodebrew switch node 7.9.0brew pin node