2011-10-10 79 views
4

我已经安装的node.js,NPM欠CSS编译时错误,少获取运行中的node.js

的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编译器?

回答

2

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

如果您安装使用Git,请执行下列操作:

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

它应该工作正常现在:)

+0

您还可以查看是否能解决它您的版本下:https://github.com /cloudhead/less.js/issues/320#issuecomment-1602207 – dresende