【问题标题】:Cannot find module 'now' - nowjs and nodejs找不到模块“现在”-nowjs 和 nodejs
【发布时间】:2012-06-06 02:53:55
【问题描述】:

我在我的主文件夹 (/home/myname/) 中安装了 nodejs。到目前为止没有问题。 然后我安装了nowjs,出现了一个警告:

检查节点路径:未找到

现在当我尝试这个例子时:http://nowjs.com/doc/example 我得到了错误:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^ Error: Cannot find module 'now'
    at Function._resolveFilename (module.js:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/var/www/www.mydomain.de/htdocs/helloworld_server.js:7:13)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Array.0 (module.js:470:10)

我猜路径有问题...有人知道如何解决这个问题吗? 谢谢

【问题讨论】:

    标签: node.js nowjs-sockets


    【解决方案1】:

    在此之前尝试一下:

    npm config set global true && \
         echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bashrc && \
         . ~/.bashrc
    

    【讨论】:

    • 遇到了同样的问题,这为我解决了这个问题。谢谢
    猜你喜欢
    • 2021-08-22
    • 2017-12-16
    • 2014-01-29
    • 1970-01-01
    • 2013-12-25
    • 2016-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多