eggjs 创建项目错误 unsupported proxy protocol: "127.0.0.1"
创建 eggjs 项目时 npm init egg --type=simple
出现错误:
npx: installed 428 in 121.096s
TypeError: unsupported proxy protocol: "127.0.0.1"
at mapOptsToProxy (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/proxy-agent/index.js:112:11)
at new ProxyAgent (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/proxy-agent/index.js:150:17)
at Command.run (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/egg-init/lib/init_command.js:49:26)
at run.next (<anonymous>)
at onFulfilled (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/co/index.js:65:19)
at /Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/co/index.js:54:5
at new Promise (<anonymous>)
at co (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/co/index.js:50:10)
at toPromise (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/co/index.js:118:63)
at next (/Users/nideshop/.npm/_npx/10820/lib/node_modules/create-egg/node_modules/co/index.js:99:29)
解决方法
npm install -g npm
设置代理,文件 ~/.zshrc
http_proxy=http://127.0.0.1:41091
https_proxy=http://127.0.0.1:41091