Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with request-promise (rus) #3

Open
AndreiSoroka opened this issue May 13, 2019 · 2 comments
Open

Problem with request-promise (rus) #3

AndreiSoroka opened this issue May 13, 2019 · 2 comments

Comments

@AndreiSoroka
Copy link

AndreiSoroka commented May 13, 2019

Добрый вечер/день/утро

Node: v10.15.3
Npm: 6.4.1
OS: macOS
+
yandex-checkout: "^1.0.12"

Код:

import YandexCheckout from 'yandex-checkout';

const shopId = process.env.YANDEX_SHOP_ID;
const secretKey = process.env.YANDEX_SECRET_KEY;

const yc = YandexCheckout({ shopId, secretKey });

export default yc

Полотно ошибки

$ npm start
###
### The "request" library is not installed automatically anymore.
### But is a dependency of "request-promise".
### Please install it with:
### npm install request --save
###

TypeError: Cannot read property 'onReady' of undefined
    at Module.load (internal/modules/cjs/loader.js:611:22)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/andreisoroka/git/-/node_modules/psl/index.js:14:19)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/andreisoroka/git/-/node_modules/tough-cookie/lib/pubsuffix-psl.js:32:11)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (/Users/andreisoroka/git/-/node_modules/tough-cookie/lib/cookie.js:35:17)

P.s. Переустановка request и request-promise, а так же добавление в общую зависимость проекта - не помогли

Падает на 4 строчке /node_modules/yandex-checkout/lib/utils.js

@AndreiSoroka
Copy link
Author

дьявол кроется в деталях...
проблемма в --experimental-modules
nodejs/node#25482
Можно поддержать es6? Ну или хотя бы заменить request на... fetch?
или... https://www.npmtrends.com/axios-vs-superagent-vs-reqwest-vs-request-promise-vs-whatwg-fetch

Прямо мир спасете! Спасибо

@roman-kudlay-lodoss
Copy link
Contributor

Здравствуйте.
Займемся решением этой проблемы.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants