Skip to content

Error when Library has no installed packages (v5.1.0) #181

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
unborn-andy opened this issue Jun 29, 2022 · 3 comments
Closed

Error when Library has no installed packages (v5.1.0) #181

unborn-andy opened this issue Jun 29, 2022 · 3 comments
Assignees
Labels
bug It's life Jim but not as we know it!

Comments

@unborn-andy
Copy link

Hello .. excellent work keeping this useful node updated and with new features !

I get an error during NR startup that seems to be related to not having any packages installed with the node's Library.

29 Jun 04:00:26 - [error] TypeError: Cannot convert undefined or null to object
    at Function.keys (<anonymous>)
    at UibPackages.updateInstalledPackageDetails (C:\Users\User\.node-red\node_modules\node-red-contrib-uibuilder\nodes\libs\package-mgt.js:297:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Software Version
Node.JS v16.14.0
npm v8.8.0
Node-RED v3.0.0-beta.3
uibuilder node v5.1.0
uibuilderFE
OS Windows 11
Browser Firefox 102
@TotallyInformation
Copy link
Owner

Many thanks for raising Andy.

If you need a work around, from a server command line:

// go to the uibRoot folder
cd ~/.node-red/uibuilder
// Install the dummy `aaa` package
npm install aaa --save
// restart node-red

That should do it.

I'll get a fix out ASAP.

Steve spotted a quick fix. In package-mgt.js at line 297:

        await Object.keys(lsParsed.dependencies).forEach( async pkgName => {
            await this.updIndividualPkgDetails(pkgName, lsParsed)
        })

change to

        await Object.keys(lsParsed.dependencies || {}).forEach( async pkgName => {
            await this.updIndividualPkgDetails(pkgName, lsParsed)
        })

@TotallyInformation TotallyInformation self-assigned this Jun 29, 2022
@TotallyInformation TotallyInformation added the bug It's life Jim but not as we know it! label Jun 29, 2022
@create-issue-branch
Copy link

TotallyInformation added a commit that referenced this issue Jun 29, 2022
@TotallyInformation
Copy link
Owner

Fixed in v5.1.1 now published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's life Jim but not as we know it!
Projects
None yet
Development

No branches or pull requests

2 participants