This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.
Closed

need help with installing modules

Hi,

I am just to begin programming on Homey. I am new to Node.js but I manage until now. I am busy learning building a Homey App and I want to use the parser Cheerio.

When I install this module using:

npm install cheerio (need to parse some html)

a number of modules will be installed and I am not able to run my app anymore on Homey. After downloading I get and socket error.

Does this mean the package is to big? Is this the right way to install the modules or there already pre-installed modules on homey?

for example if I install the module request. I get also a number of extra modules but in the buienradar app there is only one module request.

Or did I miss some documentation...

Comments

  • As alternative for the request module I recommend http.min published by @MatjaLipu . I use it also in the HTTP app and it is much smaller than request and has no dependencies.
    That cheerio module is BIG! 10 mb. I have no problem running it on homey though. But you can consider using only htmlparser for it is just 250 kb. It makes debugging where you stop/start your app a lot much faster.
  • You mean the error "socket hang up"? That had to due with a big where apps couldn't install if they were bigger than 20mb. Firmware 0.8.32 solved this issue. But I agree @ErikVanDongen, keep your apps as small as possible. Homey doesn't have that much storage capacity, especially if you have a couple of voices installed ;) 
  • I guess you're having issue because package requires native extension which are not supported by Homey.
    Try finding module that do not require native extension.

    Regarding multiple modules: You're probably using npm 3 which install all packages in root node_modules (including dependencies of dependencies). Npm 2 does not flatten modules and creates separate node_modules for each package.

    As for the size, I don't know if there is any apps limitation, but smaller is faster and in keeps more space for data and other apps.
  • MatjaLipu said:
    I guess you're having issue because package requires native extension which are not supported by Homey.
    Try finding module that do not require native extension.

    Regarding multiple modules: You're probably using npm 3 which install all packages in root node_modules (including dependencies of dependencies). Npm 2 does not flatten modules and creates separate node_modules for each package.

    As for the size, I don't know if there is any apps limitation, but smaller is faster and in keeps more space for data and other apps.
    Thanks! This helps!
This discussion has been closed.