2

I want to install the lessc provided from NPM. (on OSX)

Firstly, I installed the current version of NodeJs: 0.10.15.
It includes NPM.

Now I launch the famous command:

npm install -g lessc

and I obtain this error:

npm install -g lessc
npm http GET https://registry.npmjs.org/lessc
npm http GET https://registry.npmjs.org/lessc
npm http GET https://registry.npmjs.org/lessc
npm ERR! Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR!     at SecurePair.<anonymous> (tls.js:1350:32)
npm ERR!     at SecurePair.EventEmitter.emit (events.js:92:17)
npm ERR!     at SecurePair.maybeInitFinished (tls.js:963:10)
npm ERR!     at CleartextStream.read [as _read] (tls.js:463:15)
npm ERR!     at CleartextStream.Readable.read (_stream_readable.js:320:10)
npm ERR!     at EncryptedStream.write [as _write] (tls.js:366:25)
npm ERR!     at doWrite (_stream_writable.js:219:10)
npm ERR!     at writeOrBuffer (_stream_writable.js:209:5)
npm ERR!     at EncryptedStream.Writable.write (_stream_writable.js:180:11)
npm ERR!     at write (_stream_readable.js:573:24)

On the net, I found a workaround:

npm config set strict-ssl false

But when I relaunch the command, I get now:

npm install -g lessc
npm http GET https://registry.npmjs.org/lessc
npm http 404 https://registry.npmjs.org/lessc
npm ERR! 404 'lessc' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Darwin 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "lessc"
npm ERR! cwd /Users/me
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.3.5
npm ERR! code E404

I'm very new to NodeJs world and its packager.

Is there something I can do to manage to install lessc?

Maybe I forgot some env variables.

4

1 回答 1

15

好的,这个问题很简单:

其实我是受到这个Play 插件的启发。

显示的命令是:

npm install -g lessc  // lessc nonexisting

代替

npm install -g less

现在,使用上面指定的解决方法,它可以工作。

于 2013-08-11T14:07:39.257 回答