flatiron / prompt

a beautiful command-line prompt for node.js

Home Page:http://github.com/flatiron/prompt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failing due to Winston dependency in Node 14

patrick-rodgers opened this issue · comments

In Node 14 application seeing an error:

Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency

I traced this error back to the winston package used within prompt.

I think this is related to this Pull Request in the node engine.

If there is interest in merging a fix I can submit a PR to try and address, but this package no longer appears maintained. Any feedback available on next steps as I believe prompt to be broken in node 14.

The package really causes this warning.

Made a simple POC.

package.json:

{
  "name": "prompt-test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "prompt": "^1.0.0"
  }
}

server.js:

require('prompt')

leads to:

$ node server.js
(node:44594) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use node --trace-warnings ... to show where the warning was created)

commented

Winston version 2.4.5 fixes this issue (see winstonjs/winston#1797 (comment)). The package.json here says "winston": "2.x" on master, but that was committed on 2016-12-15 while the last version tag (v1.0.0) is from long before that. Tagging a new version based on the current master should fix this problem.

If a maintainer of this module that has the capability to publish to the npm registry ever expresses interest in some basic fixes, I would be happy to submit a PR to fix this issue. Until then I just use a forked version of this repo because I love it so much.

Guys, please update winston up to 2.4.5!

@gangstead I see you accept pull requests for the repo. Could you please publish 1.1.0 to npm? It was fixed few years ago in master: 6ebf54a

@gangstead I see you accept pull requests for the repo. Could you please publish 1.1.0 to npm? It was fixed few years ago in master: 6ebf54a

actually I am not sure whether prompt 1.1.0 fix this problem. cause I do update the prompt version to 1.1.0, but it still install the 2.1.x winston dep

@Yansongsongsong Can you double check, because 1.1.0 is published and is the same as https://github.com/flatiron/prompt/blob/master/package.json#L25