Installing a another Sails.js version locally

回眸只為那壹抹淺笑 提交于 2019-12-22 09:26:14

问题


I've installed Sails.js version 0.9.13 globally on my Mac which runs fine, but I'm trying to fiddle with the 0.10.0-rc4 locally in a folder.

Running sudo npm install sails@beta seems to work fine; my node_modules/package.json says "version": "0.10.0-rc4"

But when I run sails new testProject in that folder, the generated testProject/package.json says "sails": "0.9.13".

I know that I could just change the testProject/package.json to "version": "0.10.0-rc4" and then npm install but that doesn't work.

What am I doing wrong? How could I fix this?


回答1:


Basically, you can just run

./node_modules/sails/bin/sails.js new testProject

instead of sails new testProject once you have installed rc4 in some 'parent' folder.




回答2:


I recommend using a virtual environment like nave. It will help you not to disturb your existing installations.

Sequence would go something like this:

npm install nave -g
nave use <envname> stable
$npm install sails@beta -g


来源:https://stackoverflow.com/questions/22609546/installing-a-another-sails-js-version-locally

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!