无法在 macosx 上安装无服务器框架
Unable to install serverless framework on macosx
实际上我无法在我的 Mac 上安装无服务器。
以下是关于我的配置的一些信息:
- OSX Yosemite 10.10.5
- node.js 6.2.10
- npm 3.10.10
已启动安装无服务器的命令:
sudo npm -g install serverless
结果:
/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
serverless@1.11.0 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)
如有任何帮助,我们将不胜感激!
堆栈跟踪表明 rc
模块导致了错误。
该模块由名为 get-proxy
to determine if there are any HTTP/HTTPS proxies configured. It's trying to read the NPM configuration 的模块使用,该模块通常存储在名为 ~/.npmrc
的文件中
该错误表明该文件存在问题。
实际上我无法在我的 Mac 上安装无服务器。
以下是关于我的配置的一些信息:
- OSX Yosemite 10.10.5
- node.js 6.2.10
- npm 3.10.10
已启动安装无服务器的命令:
sudo npm -g install serverless
结果:
/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
serverless@1.11.0 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)
如有任何帮助,我们将不胜感激!
堆栈跟踪表明 rc
模块导致了错误。
该模块由名为 get-proxy
to determine if there are any HTTP/HTTPS proxies configured. It's trying to read the NPM configuration 的模块使用,该模块通常存储在名为 ~/.npmrc
该错误表明该文件存在问题。