node.js: cannot find module 'request'

后端 未结 8 1796
再見小時候
再見小時候 2020-12-07 14:29

I installed request module, and getting the error:

module.js:340
    throw err;
          ^
Error: Cannot find module \'request\'

i\'ve read

相关标签:
8条回答
  • 2020-12-07 14:54

    ReferenceError: Can't find variable: require.

    You have installed "npm", you can run as normal the script to a "localhost" "127.0.0.1".

    When you use the http.clientRequest() with "options" in a "npm" you need to install "RequireJS" inside of the module.

    A module is any file or directory in the node_modules directory that can be loaded by the Node. Install "RequiereJS" for to make work the http.clientRequest(options).

    0 讨论(0)
  • 2020-12-07 14:54

    I tried installing the module locally with version and it worked!!

    npm install request@^2.*
    

    Thanks.

    0 讨论(0)
提交回复
热议问题