在node.js中运行Less CSS编译器时出错

时间:2011-10-10 19:27:25

标签: node.js less

我安装了node.js,npm和less

node.js版本为v0.5.9-pre npm版本为1.0.10

当我运行任何lessc命令时,我收到此错误:

The "sys" module is now called "util". It should have a similar interface.


node.js:203
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
    at Function. (module.js:376:11)
    at Object. (/var/www/node/npm/node_modules/less/bin/lessc:7:8)
    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. (module.js:470:10)
    at EventEmitter._tickCallback (node.js:195:26)

我需要做些什么才能使用lessc编译器?

1 个答案:

答案 0 :(得分:2)

这是v0.5的变化,可能还没有考虑到jjs。使用节点v0.4.x。

如果使用git安装,请执行以下操作:

cd /path/to/your/node/git/repository
git checkout v0.4.12
make && sudo make install

现在应该可以正常工作:)