hoobs-org / HOOBS

Build your Smart Home with HOOBS. Connect over 2,000 Accessories to your favorite Ecosystem.
https://hoobs.org
GNU General Public License v3.0
552 stars 51 forks source link

Update nest-cam2 -> nest-cam is not possible #933

Closed nejcklinc closed 3 years ago

nejcklinc commented 3 years ago

Description Since nest-cam2 was deprecated I tried to update to nest-cam.

  1. If I run npm -g uninstall homebridge-nest-cam2 && npm -g install homebridge-nest-cam I get insufficient rights error.
  2. If I run sudo npm -g uninstall homebridge-nest-cam2 && sudo npm -g install homebridge-nest-cam I get:
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
Command failed with exit code 100: apt-get update
npm WARN puppeteer-extra@3.1.15 requires a peer of puppeteer@* but none is installed. You must install peer dependencies yourself.
  1. If I install nest-cam from plugins than I get error:
Error: The requested platform 'Nest-cam' has been registered multiple times. Please be more specific by writing one of: homebridge-nest-cam.Nest-cam, homebridge-nest-cam2.Nest-cam

So my question is how to uninstall nest-cam2 since there is no uninstall button in hoobs.

Version 3.2.10

Did you upgrade Please let us know if you upgraded from a previous version.

Did you orginally upgrade to HOOBS 3 from HOOBS 2.1.1? Did you perform an upgrade from HOOBS 2.1.1? Some things are different.

What device are you using? Please let us know the device you are running HOOBS on.

List your plugins Please include a list of the plugins you are using. We need to be able to find it on NPM. If the plugin is no published, please include a link to the repository. nest-cam2, shelly, weather plus

Post your config

{
    "server": {
        "port": 8080,
        "origin": "*",
        "autostart": 0,
        "home_setup_id": "X-HM://xxxx",
        "polling_seconds": 5
    },
    "client": {
        "default_route": "status",
        "inactive_logoff": 30,
        "theme": "hoobs-dark",
        "locale": "en",
        "temp_units": "celsius",
        "country_code": "SI",
        "postal_code": "xxx",
        "latitude": "xxxx",
        "longitude": "xxxx"
    },
    "bridge": {
        "name": "HOOBS",
        "port": 51826,
        "pin": "xxxx",
        "username": "xxxx"
    },
    "description": "",
    "ports": {},
    "accessories": [],
    "platforms": [
        {
            "platform": "Shelly",
            "plugin_map": {
                "plugin_name": "homebridge-shelly"
            },
            "name": "Shelly",
            "admin": {
                "enabled": true,
                "port": 8181
            },
            "username": "xxxx",
            "password": "xxxx",
            "devices": [
                {
                    "id": "xxxx",
                    "exclude": true
                },
                {
                    "id": "xxxx",
                    "exclude": true
                },
                {
                    "id": "xxxx",
                    "exclude": true
                },
                {
                    "id": "xxxx",
                    "exclude": true
                }
            ]
        },
        {
            "platform": "WeatherPlus",
            "service": "darksky",
            "key": "xxxx",
            "locationGeo": [
                xxxx,
                xxxx
            ],
            "nameNow": "Vreme",
            "units": "metric",
            "conditionCategory": "detailed",
            "hidden": [
                "DewPoint",
                "Ozone"
            ],
            "forecast": [
                1,
                2,
                3
            ],
            "interval": 5,
            "language": "en",
            "plugin_map": {
                "plugin_name": "homebridge-weather-plus"
            },
            "stations": []
        }
    ]
}
nejcklinc commented 3 years ago

Solution:

  1. in the HOOBS terminal paste this command to edit the package.json file:

nano /home/hoobs/.hoobs/package.json

  1. Navigate using your arrows and delete the entire line containing the chamberlain plugin in the dependencies object.

"nest-cam2": "plugin version"

  1. Save the file with ctrl + S then exit the editor with ctrl + x

  2. Run this command to fix dependencies

npm install

  1. The plugin will be gone after that.
mkellsy commented 3 years ago

HOOBS doesn't recognize globally installed plugins the -g flag should never be used. Also sudo should not be used either.

@nejcklinc solution is correct. There are root locked files in the HOOBS plugin folder.

Another solution is to delete the node_modules and reinstall the plugins

cd ~/.hoobs && sudo rm -fR ./node_modules && npm install
stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.