Due to the large number of dependencies and variables involved, several of my tower.js tutorial readers, as well as users at large, have had difficulty installing Tower. While I don’t have any “one” answer to the question, “Why won’t Tower install?” I can provide a few hints. Remember, I’m fairly new to development myself, do not consider myself an “expert” and so, while I will try to offer help, please do your own research on these topics.
First, I once again recommend installing Node.js by using NVM or Nave as this will make it easier to change versions if you need, and should install Node in a way which makes its directories more accessible.
Third, take a look at this thread , which mentions some solutions.
Fourth, you may need to either use “sudo” or “su” in front of the command, depending on how node is installed on your system. Alternately, you can try takeing ownership or changing the read and write access of the directory having the permissions difficulties with either/or/both/and “chown” and “chmod”. Both of these options have their difficulties so I’m not advocating any of them, nor am I going to attempt to explain how to do it because I don’t want to risk giving bad advice. Do your research and understand what you are attempting before trying this one.
Fifth, if you are trying out some of these options and continuing to get errors, be sure to run:
npm cache clean
As sometimes npm seems to cache something from previous attempts and can continue to have errors, even after the proper corrections have been made.
Sixth, consider installing both node and tower from source. This will place them in a local directory, and if BOTH of them are installed from source in a local directory, should take care of the vast majority of permissions errors. You should be able to find directions for installing node from source on the node.js homepage. For Tower, it goes like this:
git clone https://github.com/viatropos/tower.git
Or alternately, make a fork and clone your own copy. Then:
Seventh, this is more about running Tower once it’s installed, and/or creating new projects with it, but be sure you have a copy of MongoDB installed and running on your system.
Also, if you encounter difficulties with tower, be sure to create an issue here so that you can benefit from the help of the community, and in turn, tower’s creators can know what difficulties people are encountering and attempt to solve those.
Anyone else have suggestions or recommendations? Did something in particular work for you? Be sure to share in the comments below. Make sure you include pertinent information such as OS, node version, npm version and etc. Also, if any of the advice I give above is particularly bad or troublesome, please be sure to let me know so I can correct it. But remember, I make no claims to being an “authority,” and offer these suggestions simply from a desire to help, so please be courteous and constructive in your criticism.
Efforts are being made to simplify the installation of tower, but until that happens, I’ll try to keep you updated with any solutions I discover in my efforts to help people get started with Tower.
Hope this helps!