I want to install serverless as global.
npm install -g serverless
but when the installation process, I got the same error like this
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/serverless/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Unexpected end of JSON input while parsing near '...","querystring":"^0.2'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/fathisiddiqi/.npm/_logs/2020-09-17T07_24_40_981Z-debug.log
I have clean npm cache with npm cache clean --force
I tried again, and got another errors like this
npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/lodash (over 30000ms)
npm ERR! A complete log of this run can be found in:
npm ERR! /home/fathisiddiqi/.npm/_logs/2020-09-17T07_26_46_746Z-debug.log
Finally, i tried to install serverless again. but still got message
npm ERR! Unexpected end of JSON input while parsing near '...TTOgEjCFo9YXvGwfWu94f'
npm ERR! A complete log of this run can be found in:
npm ERR! /home/fathisiddiqi/.npm/_logs/2020-09-17T07_30_56_320Z-debug.log
Please help me. Thanks!