Cannot find module 'now' - nowjs and nodejs

南笙酒味 提交于 2019-12-12 17:05:51

问题


I installed nodejs in my home folder (/home/myname/). No problems so far. Then I installed nowjs and there was one warning:

Checking for node path: not found

Now when I try this example: http://nowjs.com/doc/example I get the error:

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)

Something with the paths is wrong I guess...anyone knows how to fix this? Thanks


回答1:


try this before :

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


来源:https://stackoverflow.com/questions/10857409/cannot-find-module-now-nowjs-and-nodejs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!