Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7916037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T14:39:38+00:00 2026-06-03T14:39:38+00:00

Edit4: I’m happy working in this in Linux now, as I got the rest

  • 0

Edit4: I’m happy working in this in Linux now, as I got the rest of the kinks with where to place and how to copy the files out of the way for the project. Going to go ahead and accept the answer and close this out.

Edit3: I have a workaround in place for the moment, namely working out of my Debian VM instead of Windows, thanks to Len’s comments. However, I am leaving this unanswered for now to see if someone can solve the Windows problem.

I have slowly been working my way through an install of Node.js on my Windows 7 desktop. I say slowly because every step of the way has had issues, from PATH variables not updating, to not knowing I needed python, to npm permissions errors. Anyway, I’ve worked through a ton of them with Google’s help, but this has me completely stumped:

D:\Website\Webscraper>node webscrape.js

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
TypeError: Cannot read property 'userAgent' of undefined
    at D:\Website\Webscraper\node_modules\jquery\lib\node-jquery.js:87:23
    at D:\Website\Webscraper\node_modules\jquery\lib\node-jquery.js:995:2
    at create (D:\Website\Webscraper\node_modules\jquery\lib\node-jquery.js:9416:2)
    at D:\Website\Webscraper\node_modules\jquery\lib\node-jquery.js:9422:18
    at Object.<anonymous> (D:\Website\Webscraper\node_modules\jquery\lib\node-jquery.js:9424:1)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)

Here’s my entire code:

var $ = require('jquery');

After endless errors about missing packages, I have the following installed locally via npm:

  • jquery@1.7.2
  • htmlparser@1.7.6
  • jsdom@0.2.14
  • cssom@0.2.3
  • request@2.9.202
  • xmlhttprequest@1.3.0
  • location@0.0.1
  • navigator@1.0.1

But since the error I am now getting is a pretty generic JS error, and searching for it specifically has netted 0 google hits, I am stumped. All I want to do is run jquery in node.js. This was supposed to require ~3 lines of input. What the heck am I missing?

Edit: Looking into the navigator.userAgent end of things, it looks like the navigator package I downloaded is meant to fix this, but it’s not working. I also tried editing node-jquery in the jquery module, overriding the global variable “navigator” with one that sets my own userAgent, and a couple other things, but nothing even changes the error, much less fixes the problem.

Edit2: (fixed for Debian, see comments under Len’s answer)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T14:39:40+00:00Added an answer on June 3, 2026 at 2:39 pm

    Works for me!

    aeka ~/test$ cat webscrape.js 
    var $ = require('jquery');
    aeka ~/test$ node webscrape.js 
    aeka ~/test$ echo $?
    0
    aeka ~/test$ npm ls
    /Users/annelicuss/test
    ├─┬ jquery@1.7.2 
    │ ├── htmlparser@1.7.6 
    │ ├─┬ jsdom@0.2.14 
    │ │ ├─┬ contextify@0.1.2 
    │ │ │ └── bindings@0.3.0 
    │ │ ├── cssom@0.2.3 
    │ │ └── request@2.9.202 
    │ └── xmlhttprequest@1.3.0 
    └── navigator@1.0.1 
    
    aeka ~/test$ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: There's now a doc page on this so this question is irrelevant, also
edit4: wikified, since this seems to have morphed more into a discussion than a
I am working on a project involving Dynamic Programming and am struck on this
I've got a almost completed app now and the next feature I want to
EDIT4: Got my application to write the user to the active directory, but the
EDIT: Now a Major Motion Blog Post at http://messymatters.com/sealedbids The idea of rot13 is
EDIT: This post was originally specific to ASP.NET, but after thinking about it I'm
edit alright, I guess C is painful in nature--Just, this part, is particularly painful.
hmm i got a homework, its 2 hours and i still have no clue
I working on a maze generator in C# which generates big mazes and then

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.