Node.js cannot find module 'readable-stream'

前端 未结 5 1860
醉话见心
醉话见心 2020-12-11 02:11

I am new to node.js and stuck on the following. Any help will be appreciated:

I am running node.js (0.10.28) on ubuntu (12.10). The code I am working on is:

相关标签:
5条回答
  • 2020-12-11 02:26

    In my case, (windows) after uninstalling nodejs, and before reinstalling it I had to delete the folder:

    C:\Program Files\nodejs\node_modules\npm

    and after reinstalling node it worked like a sharm

    0 讨论(0)
  • 2020-12-11 02:28

    I got this error for the a long while. Stupidly I hadn't installed gulp... In short this problem occurs when a package is missing.

    npm install gulp -g
    

    I would suggest working out which task you are running and then install that.

    0 讨论(0)
  • 2020-12-11 02:31

    After grepping I found:

      $ cd /usr/lib/
      $ ack-grep readable-stream
    nodejs/sha/index.js
    3:var Transform = require('stream').Transform || require('readable-stream').Transform
    

    and change that line to:

    var Transform = require('stream').Transform // || require('readable-stream').Transform
    

    and error goes out!

    -- System Information:

    0 讨论(0)
  • 2020-12-11 02:32

    I was having this problem building a vue library. Deleting node_modules and re-running npm isntall and then rebuilding my lib worked.

    0 讨论(0)
  • 2020-12-11 02:38

    There were many reason for this issue: I have faced this issue because I had older version of node.js related files.

    1. Un-install the node.js
    2. Go to your user folder like C:\Users\<uname> and find all the node.js related files and delete everything.
    3. Install node.js freshly

    It worked for me.

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