You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I look at my console, here is the code snippet it's complaining about:
`var isWindows = process.platform === 'win32'
var path = require('path')
var exec = require('child_process').exec
var osTmpdir = require('os-tmpdir')
var osHomedir = require('os-homedir')
// looking up envs is a bit costly.
// Also, sometimes we want to have a fallback
// Pass in a callback to wait for the fallback on failures
// After the first lookup, always returns the same thing.
function memo (key, lookup, fallback) {
var fell = false
var falling = false
exports[key] = function (cb) {
var val = lookup()
if (!val && !fell && !falling && fallback) {
fell = true
falling = true
exec(fallback, function (er, output, stderr) {
falling = false
if (er) return // oh well, we tried
val = output.trim()
})
}
exports[key] = function (cb) {
if (cb) process.nextTick(cb.bind(null, null, val))
return val
}
if (cb && !falling) process.nextTick(cb.bind(null, null, val))
return val
}
}`
Anyone know what the issue may be?
Thank you.
The text was updated successfully, but these errors were encountered:
I was trying to build a web application that used this package, and I ran into the same issue as you. I think it's because this package is meant to be used in a backend node.js service rather than from a browser. I found the snippet that was err'ing out from the osenv package, and I noticed that some other javascript users ran into similar issues
I'm getting the following error when attempting to require
google-translate-api
:I'm including it with the following code:
When I look at my console, here is the code snippet it's complaining about:
`var isWindows = process.platform === 'win32'
var path = require('path')
var exec = require('child_process').exec
var osTmpdir = require('os-tmpdir')
var osHomedir = require('os-homedir')
// looking up envs is a bit costly.
// Also, sometimes we want to have a fallback
// Pass in a callback to wait for the fallback on failures
// After the first lookup, always returns the same thing.
function memo (key, lookup, fallback) {
var fell = false
var falling = false
exports[key] = function (cb) {
var val = lookup()
if (!val && !fell && !falling && fallback) {
fell = true
falling = true
exec(fallback, function (er, output, stderr) {
falling = false
if (er) return // oh well, we tried
val = output.trim()
})
}
exports[key] = function (cb) {
if (cb) process.nextTick(cb.bind(null, null, val))
return val
}
if (cb && !falling) process.nextTick(cb.bind(null, null, val))
return val
}
}`
Anyone know what the issue may be?
Thank you.
The text was updated successfully, but these errors were encountered: