Hi All,
I recently found an issue when globally install serverless.
I could see that it is failing on Serverless post-installation steps. But I don’t actually know what to interpret from the information I’ve been given. Could someone give me a pointer on this issue?
As for the information of my stack, I am running Node on a Python Virtual Environment.
Thanks
Another screenshot of the npm log file attached here.
The problem was with the Node version 10.7. Running this on the LTS version of Node works fine.
Also having this issue in macOS 10.13.6:
node -v
v10.7.0
npm -v
6.2.0
npm install -g serverless@1.26.1
/usr/local/bin/serverless -> /usr/local/lib/node_modules/serverless/bin/serverless
/usr/local/bin/slss -> /usr/local/lib/node_modules/serverless/bin/serverless
/usr/local/bin/sls -> /usr/local/lib/node_modules/serverless/bin/serverless
> spawn-sync@1.0.15 postinstall /usr/local/lib/node_modules/serverless/node_modules/spawn-sync
> node postinstall
> serverless@1.26.1 postinstall /usr/local/lib/node_modules/serverless
> node ./scripts/postinstall.js
events.js:167
throw er; // Unhandled 'error' event
^
Error: socket hang up
at createHangUpError (_http_client.js:313:15)
at TLSSocket.socketOnEnd (_http_client.js:416:23)
at TLSSocket.emit (events.js:187:15)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at TLSSocket.socketOnEnd (_http_client.js:416:9)
at TLSSocket.emit (events.js:187:15)
[... lines matching original stack trace ...]
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serverless@1.26.1 postinstall: `node ./scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverless@1.26.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Thanks
buggy
July 19, 2018, 11:07am
5
Bug reports need to go to Github. There’s already an issue for it.
opened 04:43AM - 19 Jul 18 UTC
closed 07:35AM - 20 Jul 18 UTC
bug
<!--
1. If you have a question and not a bug/feature request please ask it at h… ttp://forum.serverless.com
2. Please check if an issue already exists so there are no duplicates
3. Check out and follow our Guidelines: https://github.com/serverless/serverless/blob/master/CONTRIBUTING.md
4. Fill out the whole template so we have a good overview on the issue
5. Do not remove any section of the template. If something is not applicable leave it empty but leave it in the Issue
6. Please follow the template, otherwise we'll have to ask you to update it
-->
# This is a Bug Report
## Description
For bug reports:
* What went wrong?
"npm install" fails at the serverless@1.28.0 postinstall script.
* What did you expect should have happened?
I had expected to install the serverless package.
* What was the config you used?: Nothing.
* What stacktrace or error message from your provider did you see?: Nothing.
## Additional Data
* ***Serverless Framework Version you're using***:
v1.28.0
* ***Operating System***:
macOS 10.13.6
Node.js v10.7.0
* ***Stack Trace***:
```
$ npm install
> serverless@1.28.0 postinstall /Users/itok/workspace/serverless
> node ./scripts/postinstall.js
Error: socket hang up
at createHangUpError (_http_client.js:313:15)
at TLSSocket.socketOnEnd (_http_client.js:416:23)
at TLSSocket.emit (events.js:187:15)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at endReadableNT (_stream_readable.js:1081:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
```
* ***Provider Error messages***: Nothing.
Tee88
September 18, 2018, 3:43pm
6
I had the same exact issue! In my case it turned out that I had different sls
versions installed (^1.26.1 in my package.json and 1.32.0 globally). So I just edited the one in my json file to match the global version.