Getting an error when running the Less CSS compile

2019-06-24 03:40发布

问题:

I have installed node.js, npm, and less

node.js version is v0.5.9-pre npm version is 1.0.10

When I run any lessc command I get this error:

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)

What do I need to do to be able to use the lessc compiler?

回答1:

This is a change in v0.5 that probably lessjs does not take into account yet. Use node v0.4.x.

If you installed using git, do the following:

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

It should work fine now :)



标签: node.js less