[Labs-l] Node.js updates

Ricordisamoa ricordisamoa at openmailbox.org
Tue Apr 21 13:46:14 UTC 2015


Il 17/04/2015 19:42, Ricordisamoa ha scritto:
> Il 17/04/2015 18:43, Daniel Friesen ha scritto:
>> On 2015-04-17 8:16 AM, Ricordisamoa wrote:
>>> Il 16/04/2015 21:50, Yuvi Panda ha scritto:
>>>>
>>>>
>>>> On Thu, 16 Apr 2015 at 11:32 Ricordisamoa 
>>>> <ricordisamoa at openmailbox.org 
>>>> <mailto:ricordisamoa at openmailbox.org>> wrote:
>>>>
>>>>
>>>>     nvm: command not found :(
>>>>
>>>>
>>>> It allows per-user node installs. See 
>>>> https://github.com/creationix/nvm. Shouldn't require root, and you 
>>>> can set it up just for your tool. Easy way to experiment :)
>>>>
>>>
>>> By no means :(
>>>
>>> tools.jshint at tools-bastion-01:~$ nvm --version
>>> 0.24.1
>>> tools.jshint at tools-bastion-01:~$ node --version
>>> v0.12.2
>>>
>>> And yet: https://tools.wmflabs.org/jshint/
>> nvm's version has nothing to do with the node version, nvm installs 
>> various node installs.
>>
>> Also it works like rvm if you've ever used it. nvm installs releases 
>> in it's own folder and when you `nvm use ???` it changes your 
>> environment so that nvm's node, etc... are on your PATH, etc... 
>> instead of the system node.
>>
>> So it doesn't replace the system node and your env is not the env 
>> that daemons execute in (if nvm did, your testing would have caused 
>> trouble for other tools users by replacing node for their tools).
>>
>> To get the daemon to use a different node version something will need 
>> to be changed in the spawning of the daemon to invoke some nvm 
>> commands to change what node is used to run the tool.
>>
>> ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
>
> It works by putting
>
> "scripts": {
>     "start": "~/.nvm/versions/node/v0.12.2/bin/node server.js"
> }
>
> in ~/www/js/package.json. It looks a bit hackish though...
> and nvm does not work in "start". 

I just ran:

nvm install io.js

then updated package.json with:

"start": "~/.nvm/versions/io.js/v1.8.1/bin/iojs --harmony_classes server.js"

...and ES6 classes are available!
https://tools.wmflabs.org/jshint/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/labs-l/attachments/20150421/cdc48cd4/attachment.html>


More information about the Labs-l mailing list