简体   繁体   中英

Node.js - How to install requestHandlers..?

I am initiating a "stat" event using index.js file, I believe all my code are fine. when i start my server i am getting this issue..

module.js:340
    throw err;
          ^
Error: Cannot find module './requestHandlers'

here is my index.js:

var server = require("./server");
var router = require("./router");
var requestHandlers = require("./requestHandlers");

var handle = {};
handle["/"] = requestHandlers.start;
handle["/start"] = requestHandlers.start;
handle["/upload"] = requestHandlers.upload;

server.start(router.route, handle);

I understand my "requestHandlers" - module is missing, how can i install that module? i do have the "npm" installed..

any one help me?

How about check the file name of "requestHandlers.js" I meet this error by missing the 's' at the end of "requestHandlers".

hope this can help you.

I meet this error by missing making "requestHandlers.js" file.

you need create "requestHandlers.js" file.

Check back to http://www.nodebeginner.org

将第1到11行(第21页的“ Node Beginner”一书的顶部)放在一个名为requestHandlers.js的文件中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM