2011-10-10 80 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