在node.js中运行Less CSS编译器时出现错误 [英] Getting an error when running the Less CSS compiler in node.js

查看:165
本文介绍了在node.js中运行Less CSS编译器时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了node.js,npm和更少的

I have installed node.js, npm, and less

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

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

当我运行任何lessc命令时,都会出现此错误:

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)

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

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

推荐答案

这是v0.5中的一项更改,它可能还没有lessjs.使用节点v0.4.x.

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

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

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 CSS编译器时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆