我在我的主文件夹(/home/myname/)中安装了nodejs。到目前为止没有问题。 然后我安装了 nowjs 并出现了一个警告:
Checking for node path: not found
现在当我尝试这个例子时: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)
我猜路径有问题......有人知道如何解决这个问题吗? 谢谢
最佳答案
先尝试一下:
npm config set global true && \
echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bashrc && \
. ~/.bashrc
关于node.js - 找不到模块 'now' - nowjs 和 nodejs,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10857409/