I am having similar problem as discussed here: https://github.com/request/request-promise/issues/183
I am using Request-Promise@4.2.2 and Tough-Cookie@2.3.4
And getting the same error:
TypeError: str.trim is not a function
I also played around with npm-dedupe
Any clue,
My code looks like this:
let cookie = new tough.Cookie({domain: '.companyName.ninja',
httpOnly: true,
name: '_application_session',
path: '/',
secure: false,
value: 'f044888d39e2d19126716d9f54028700' })
let cookieJar = request.jar()
cookieJar.setCookie(cookie, 'http://application.companyName.ninja/')
options.jar = cookieJar