question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

browser unable to load latest node version

See original GitHub issue

i’m running my Mocha scripts via Browserify in browser but got the following error in browser’s console:

“Uncaught Error: Sync-request requires node version 0.12 or later. If you need to use it with an older version of node you can npm install sync-request@2.2.0, which was the last version to support older versions of node.”

However installed nodejs’s version on machine is `v9.5.0’

node_v

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
ljharbcommented, Apr 2, 2018

Synchronous requests aren’t really possible in the browser (they’re possible but deprecated). Even in node, I’d recommend only doing requests asynchronously.

0reactions
ForbesLindesaycommented, Apr 6, 2018

You cannot get spawn-sync to work in the browser. That is literally impossible. What you can do is use sync-request in the browser, because it provides a separate implementation specifically tailored for the browser.

That grunt file is too large for me to want to get into unpicking and debugging what’s going wrong. My advice would be to start with the simplest setup you can possibly have to demonstrate the problem. i.e. use grunt-browserify (with no other grunt modules) to build a script that just contains var sr = require('sync-request');sr('GET', '/'); and see if you can get the resulting script to run without error.

If that still errors, you’ll be able to post a really succinct example of what fails, and it’s much more likely that someone will have time to help you figure out what’s going wrong.

Read more comments on GitHub >

github_iconTop Results From Across the Web

browser unable to load latest node version #19747 - GitHub
Version : v9.5.0 Platform: Windows 64bit Subsystem: i'm running my Mocha scripts via Browserify in browser but got the following error in ...
Read more >
correctly downloaded node.js but still unable to install browser ...
This is simply a message telling you that fsevents wasn't installed because it's an optional package, but browser-events was installed.
Read more >
How to Easily Update Node.js to the Latest Version
Another way of updating your Node.js on macOS and Windows is to go to the official download site and install the most recent...
Read more >
How to Fix "Unable to load Node-API Library" with Cypress on ...
Here's how to fix the "Unable to Load Node-API Library" error that can come up when trying to use Prisma in Cypress tasks...
Read more >
Node.js Error: Cannot GET/ from running the url on the web ...
Last Updated : 04 Aug, 2022 ... Problem Statement: On running a Node.js application URL on the web browser it throws the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found