Re: [Express-js] Missing "qs" module

2,317 views
Skip to first unread message

dale tan

unread,
Jul 16, 2011, 9:44:45 AM7/16/11
to expre...@googlegroups.com
I just installed express on a different machine, pulled down my git repo, ran `npm install -d` and ran `node-dev app.js` and `node app.js` both of which threw this error:

Error: Cannot find module 'qs'
    at Function._resolveFilename (module.js:317:11)
    at Function._load (module.js:262:25)
    at require (module.js:346:19)
    at Object.<anonymous> (/site/node_modules/connect/lib/middleware/bodyParser.js:13:10)
    at Module._compile (module.js:406:26)
    at Object..js (module.js:445:10)
    at Object..js (/usr/local/lib/node_modules/node-dev/wrapper.js:57:18)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at require (module.js:346:19)

I'm not sure why this is happening on this one machine, but it works on two other machines i've worked with.
any clues? 

using node v0.4.9 and express 2.4.2

thanks
dale

Leland Tseng

unread,
Jul 16, 2011, 10:06:33 AM7/16/11
to expre...@googlegroups.com
qs is node-querystring lib,so you can download it. and use  command "ln -s  XXX  qs.js" 
ok?

dale tan

unread,
Jul 16, 2011, 10:35:08 AM7/16/11
to expre...@googlegroups.com
is that not a package that comes default with a node install?

On Sat, Jul 16, 2011 at 10:06 AM, Leland Tseng <lelan...@gmail.com> wrote:
qs is node-querystring lib,so you can download it. and use  command "ln -s  XXX  qs.js" 
ok?

--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.



--
-- 
CONFIDENTIALITY NOTICE: This e-mail transmission, and any documents, files or previous e-mail messages attached to it may contain confidential
information that is legally privileged and is intended for the designated
recipient only. If you have received it in error, please notify the sender
immediately and delete the original. Any other use of the email by you is
STRICTLY PROHIBITED.

Leland Tseng

unread,
Jul 16, 2011, 10:56:57 AM7/16/11
to expre...@googlegroups.com
you mkdir ~/.node_libraries , and cd ~/.node_libraries , and use this commit ->  git clone https://github.com/visionmedia/node-querystring.git , and use ln commit like it -> ln -s node-querystring/index.js qs.js

dale tan

unread,
Jul 16, 2011, 11:19:33 AM7/16/11
to expre...@googlegroups.com
leland, i did a search for `require('qs')` (there were none w/ double quotes) and found the qs module included for connect and express.  Wouldn't this be sufficient to run the qs module since the module is only being called in that context?  I don't remember needing to install the qs module on my other two machines.

On Sat, Jul 16, 2011 at 10:56 AM, Leland Tseng <lelan...@gmail.com> wrote:
you mkdir ~/.node_libraries , and cd ~/.node_libraries , and use this commit ->  git clone https://github.com/visionmedia/node-querystring.git , and use ln commit like it -> ln -s node-querystring/index.js qs.js

--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.

TJ Holowaychuk

unread,
Jul 16, 2011, 12:18:01 PM7/16/11
to expre...@googlegroups.com
why not use npm to install? it will get all these deps for you

-- 
TJ Holowaychuk

dale tan

unread,
Jul 16, 2011, 12:29:59 PM7/16/11
to expre...@googlegroups.com
TJ, i did `npm install -d` and for some reason it didn't istall that dependency.  here is my package.json file for my project:

{
    "name": "app"
  , "version": "0.0.1"
  , "private": true
  , "dependencies": {
      "express": "2.4.2"
    , "connect": "1.5.1 < 2.0.0"
    , "connect-form": "0.2.1"
    , "connect-mongodb": "1.0.0rc2"
    , "connect-timeout": "0.0.1"
    , "dateformat": "1.0.1-1.2.3"
    , "ejs": "0.4.3"
    , "everyauth": "0.2.15"
    , "hamljs": "0.5.1"
    , "jade": ">= 0.0.1"
    , "mailer": "0.6.5"
    , "mongoose": "1.7.2"
    , "mongoose-auth": "0.0.11"
    , "node-markdown": "0.1.0"
    , "stylus": "0.13.5"
  }
}

I haven't had any issues with my other two computers and a server i use so i'm not sure why this one is causing an issue.  

Both the express module and connect module have "qs": ">= 0.0.6" listed as dependencies in their respective package.json file.

dale

TJ Holowaychuk

unread,
Jul 16, 2011, 12:31:40 PM7/16/11
to expre...@googlegroups.com
weird! sounds like an npm bug then

-- 
TJ Holowaychuk

dale tan

unread,
Jul 16, 2011, 12:33:00 PM7/16/11
to expre...@googlegroups.com
I'll check which npm version i'm using on that machine and see if that is the issue.

dale

Leland Tseng

unread,
Jul 16, 2011, 7:00:27 PM7/16/11
to expre...@googlegroups.com
digression,
now express must use connect 1.5.2 , 1.6.0 not compatible.

vision media [ Tj Holowaychuk ]

unread,
Jul 17, 2011, 12:26:52 PM7/17/11
to expre...@googlegroups.com
where do you get that?

On Sat, Jul 16, 2011 at 4:00 PM, Leland Tseng <lelan...@gmail.com> wrote:
digression,
now express must use connect 1.5.2 , 1.6.0 not compatible.

--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.



--
Tj Holowaychuk
Vision Media
President & Creative Lead

Leland Tseng

unread,
Jul 17, 2011, 8:48:45 PM7/17/11
to expre...@googlegroups.com
now express and now connect version, if run example. have a error.

node.js:189
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (/home/brighthas/.node_libraries/express/lib/http.js:51:35)

    at Module._compile (module.js:406:26)
    at Object..js (module.js:445:10)
    at Module.load (module.js:334:31)
    at Function._load (module.js:293:12)
    at require (module.js:346:19)
    at Object.<anonymous> (/home/brighthas/.node_libraries/express/lib/https.js:13:18)

    at Module._compile (module.js:406:26)
    at Object..js (module.js:445:10)
    at Module.load (module.js:334:31)

but, use connect 1.5.2 no error.

Leland Tseng

unread,
Jul 18, 2011, 9:11:00 PM7/18/11
to expre...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages