wirecardBrasil / moip-sdk-node

Módulo Node.js para integração com API Moip v2
MIT License
58 stars 14 forks source link

I tried to use your package but It does not work. There are some mistakes when you try use it with React. #28

Closed valdvogel closed 6 years ago

valdvogel commented 6 years ago

The "request" library is not installed automatically anymore.

But required by "request-promise".

npm install request --save

valdvogel commented 6 years ago

ERROR in ./node_modules/tough-cookie/lib/cookie.js Module not found: Error: Can't resolve 'net' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/tough-cookie/lib' @ ./node_modules/tough-cookie/lib/cookie.js 32:10-24 @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/request/lib/har.js Module not found: Error: Can't resolve 'fs' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/request/lib' @ ./node_modules/request/lib/har.js 3:9-22 @ ./node_modules/request/request.js @ ./node_modules/request/index.js @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/forever-agent/index.js Module not found: Error: Can't resolve 'net' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/forever-agent' @ ./node_modules/forever-agent/index.js 6:10-24 @ ./node_modules/request/request.js @ ./node_modules/request/index.js @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/forever-agent/index.js Module not found: Error: Can't resolve 'tls' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/forever-agent' @ ./node_modules/forever-agent/index.js 7:10-24 @ ./node_modules/request/request.js @ ./node_modules/request/index.js @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/tunnel-agent/index.js Module not found: Error: Can't resolve 'net' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/tunnel-agent' @ ./node_modules/tunnel-agent/index.js 3:10-24 @ ./node_modules/request/lib/tunnel.js @ ./node_modules/request/request.js @ ./node_modules/request/index.js @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

ERROR in ./node_modules/tunnel-agent/index.js Module not found: Error: Can't resolve 'tls' in '/Volumes/Kokada_HD/Tecnologia/Programacao/React/xpto/node_modules/tunnel-agent' @ ./node_modules/tunnel-agent/index.js 4:10-24 @ ./node_modules/request/lib/tunnel.js @ ./node_modules/request/request.js @ ./node_modules/request/index.js @ ./node_modules/request-promise/lib/rp.js @ ./node_modules/moip-sdk-node/dist/client/api.js @ ./node_modules/moip-sdk-node/dist/resources/customer.js @ ./node_modules/moip-sdk-node/dist/client/resources.js @ ./node_modules/moip-sdk-node/dist/client/index.js @ ./node_modules/moip-sdk-node/index.js @ ./src/moip/moip.js @ ./src/components/CheckoutPage.js @ ./src/routes/AppRouter.js @ ./src/app.js @ multi (webpack)-dev-server/client?http://localhost:8080 ./src/app.js

Igor-Lopes commented 6 years ago

This SDK is intended to be used on Backend (Node.js). All libs were developed to be compatible with Node and NPM. Using it on Frontend, may not work properly, as well, it may leave your Moip credentials vulnerable.

valdvogel commented 6 years ago

Great!