Reputation: 13
Actually I'm unable to install serverless on my Mac.
Here are some information about my config:
Command launched to install serveless :
sudo npm -g install serverless
result :
/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
[email protected] postinstall /usr/local/lib/node_modules/serverless
node ./scripts/postinstall.js
Unhandled rejection SyntaxError: Unexpected token \ in JSON at position 1
at Object.parse (native)
at exports.parse (/usr/local/lib/node_modules/serverless/node_modules/rc/lib/utils.js:15:17)
at addConfigFile (/usr/local/lib/node_modules/serverless/node_modules/rc/index.js:31:20)
at Array.forEach (native)
at module.exports (/usr/local/lib/node_modules/serverless/node_modules/rc/index.js:44:36)
at Object. (/usr/local/lib/node_modules/serverless/node_modules/get-proxy/index.js:2:25)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/usr/local/lib/node_modules/serverless/node_modules/caw/index.js:3:18)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Any help would be appreciated !
Upvotes: 1
Views: 1174
Reputation: 203494
The stack trace suggests that the rc
module is causing the error.
That module is used by a module called get-proxy
to determine if there are any HTTP/HTTPS proxies configured. It's trying to read the NPM configuration, which is typically stored in a file called ~/.npmrc
The error suggests there's an issue with that file.
Upvotes: 2