Request: Error: Cannot find module 'request'

Created on 29 Sep 2017  ·  3Comments  ·  Source: request/request

Linux-deepin

Install steps:

sudo npm install --save request -g
node
> var request = require('request');
Error: Cannot find module 'request'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at repl:1:15
    at sigintHandlersWrap (vm.js:32:31)
    at sigintHandlersWrap (vm.js:96:12)
    at ContextifyScript.Script.runInContext (vm.js:31:12)
    at REPLServer.defaultEval (repl.js:308:29)
    at bound (domain.js:280:14)
> 

How could i require the request lib..?

Most helpful comment

ok i knew it...
Steps:
1.cd your project
2.npm init --yes
3.sudo npm install --save request -g
Bingo!

All 3 comments

same here. it gives me a headache trying to figure out :(. Anybody can tell me what happened?

ok i knew it...
Steps:
1.cd your project
2.npm init --yes
3.sudo npm install --save request -g
Bingo!

Was this page helpful?
0 / 5 - 0 ratings