Search code examples
ibm-cloudnode-red

IBM Cloud Node-RED Manage Palette doesn't install items


I'm on IBM Cloud trying to install node-red-node-smooth from the manage palette, and I'm getting an error. I've tried several other packages as well. The error that I get in my debug log shows:

npm WARN saveError ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/home/vcap/app/.node-red/package.json'
npm WARN .node-red No description
npm WARN .node-red No repository field.
npm WARN .node-red No README data
npm WARN .node-red No license field.

+ node-red-node-smooth@0.1.0
updated 1 package in 4.726s
npm ERR! Object.entries is not a function

npm ERR! A complete log of this run can be found in:
npm ERR! /home/vcap/app/.npm/_logs/2018-05-10T15_01_53_296Z-debug.log

The log file has a stack trace that starts with this:

106 verbose stack TypeError: Object.entries is not a function

Is there something obvious that I'm doing wrong?


Solution

  • instances deployed in the last few days got npm 6.0.0. This version of npm contained a bug that caused the Object.entries is not a function error.

    npm released 6.0.1 that fixed this issue today (Thursday May 10th 2018)

    You have three possible ways to fix your instance:

    1. deploy a new instance and copy your flows over
    2. or, set the NPM_CONFIG_AUDIT environment variable* to false - which stops npm 6.0.0 going down the code path containing the bug.
    3. or, set the NODE_MODULE_CACHE environment variable* to false and trigger a restage of your application - that will get npm 6.0.1 installed.

    If you don't have much in the way of flows at this point, deleting and creating a new instance is the easiest option.

    If you want to 'repair' your existing instance, option 2 is probably the easiest as it just requires an automatic restart of the app, rather than a restage which requires the cf command-line tool to trigger manually.

    To set an environment variable within your IBM Cloud application, go to your application's dashboard page. Go to the Runtime section in the left-hand navigation. Select 'Environment Variables' in the tabs across the top and scroll down to the 'User defined' section of the page. Click 'Add' - enter the env var details and click 'Save'. Your app will be restarted with the variable set.