Code Monkey home page Code Monkey logo

Comments (12)

floscher avatar floscher commented on September 28, 2024

Exactly: winston uses colors in an affected version (all versions >1.4.0 are affected):
https://github.com/winstonjs/winston/blob/65ab472f54906c72c6c72cffc0a12c9f1d0fe995/package.json#L46

The dependency on colors should be pinned to version 1.4.0. See Marak/colors.js#285

from module-packer.

PiSaucer avatar PiSaucer commented on September 28, 2024

It does use 1.4.0, but it is affecting my system(s) still. Idk if I am doing something wrong. I just removed my own fork since I don't need a logger.

from module-packer.

DanielRuf avatar DanielRuf commented on September 28, 2024

@PiSaucer you may have to use npm / yarn resolutions to pin it or check your lockfile. And the package.json should use "1.4.0", without any ~ or ^.

from module-packer.

floscher avatar floscher commented on September 28, 2024

The package file of winston states ^1.4.0, so NPM would update to the newest 1.4.x version, which is affected. So you are probably using a newer version.

As @DanielRuf said, check the package-lock file and explicitly set 1.4.0.

from module-packer.

PiSaucer avatar PiSaucer commented on September 28, 2024

After removing the ^ I get following errors:

Error: Cannot find module 'color'
Require stack:
- /module-packer/source/node_modules/colorspace/index.js
- /module-packer/source/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js
- /module-packer/source/node_modules/@dabh/diagnostics/node/development.js
- /module-packer/source/node_modules/@dabh/diagnostics/node/index.js
- /module-packer/source/node_modules/winston/lib/winston/exception-handler.js
- /module-packer/source/node_modules/winston/lib/winston/logger.js
- /module-packer/source/node_modules/winston/lib/winston/create-logger.js
- /module-packer/source/node_modules/winston/lib/winston.js
- /module-packer/source/cli-out/cli/main.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/module-packer/source/node_modules/colorspace/index.js:3:13)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:999:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/module-packer/source/node_modules/colorspace/index.js',
    '/module-packer/source/node_modules/@dabh/diagnostics/modifiers/namespace-ansi.js',
    '/module-packer/source/node_modules/@dabh/diagnostics/node/development.js',
    '/module-packer/source/node_modules/@dabh/diagnostics/node/index.js',
    '/module-packer/source/node_modules/winston/lib/winston/exception-handler.js',
    '/module-packer/source/node_modules/winston/lib/winston/logger.js',
    '/module-packer/source/node_modules/winston/lib/winston/create-logger.js',
    '/module-packer/source/node_modules/winston/lib/winston.js',
    '/module-packer/source/cli-out/cli/main.js'
  ]
}

Node.js v17.1.0

from module-packer.

floscher avatar floscher commented on September 28, 2024

Looks like you forgot an s:

Error: Cannot find module 'color'

from module-packer.

DanielRuf avatar DanielRuf commented on September 28, 2024

@PiSaucer the package is named colors, not color.

from module-packer.

PiSaucer avatar PiSaucer commented on September 28, 2024

This is Winston's Package:

{
  "name": "winston",
  "description": "A logger for just about everything.",
  "version": "3.3.3",
  "author": "Charlie Robbins <[email protected]>",
  "maintainers": [
    "Jarrett Cruger <[email protected]>",
    "Chris Alderson <[email protected]>",
    "David Hyde <[email protected]>"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/winstonjs/winston.git"
  },
  "keywords": [
    "winston",
    "logger",
    "logging",
    "logs",
    "sysadmin",
    "bunyan",
    "pino",
    "loglevel",
    "tools",
    "json",
    "stream"
  ],
  "dependencies": {
    "async": "^3.1.0",
    "@dabh/diagnostics": "^2.0.2",
    "is-stream": "^2.0.0",
    "logform": "^2.2.0",
    "one-time": "^1.0.0",
    "readable-stream": "^3.4.0",
    "stack-trace": "0.0.x",
    "triple-beam": "^1.3.0",
    "winston-transport": "^4.4.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.10.3",
    "@babel/core": "^7.10.3",
    "@babel/preset-env": "^7.10.3",
    "@types/node": "^14.0.13",
    "abstract-winston-transport": "^0.5.1",
    "assume": "^2.2.0",
    "colors": "1.4.0",
    "cross-spawn-async": "^2.2.5",
    "eslint-config-populist": "^4.2.0",
    "hock": "^1.4.1",
    "mocha": "^8.0.1",
    "nyc": "^15.1.0",
    "rimraf": "^3.0.2",
    "split2": "^3.1.1",
    "std-mocks": "^1.0.1",
    "through2": "^3.0.1",
    "winston-compat": "^0.1.5"
  },
  "main": "./lib/winston",
  "browser": "./dist/winston",
  "types": "./index.d.ts",
  "scripts": {
    "lint": "populist lib/*.js lib/winston/*.js lib/winston/**/*.js",
    "pretest": "npm run lint",
    "test": "nyc --reporter=text --reporter lcov npm run test:mocha",
    "test:mocha": "mocha test/*.test.js test/**/*.test.js --exit",
    "build": "./node_modules/.bin/rimraf dist && babel lib -d dist",
    "prepublishOnly": "npm run build"
  },
  "engines": {
    "node": ">= 6.4.0"
  },
  "license": "MIT"
}

from module-packer.

PiSaucer avatar PiSaucer commented on September 28, 2024

After changing Winston's Package and installing [email protected] (from the colorspace package), it is acting as normal. To me, this seems like a hassle to do each time a person wants to install module-packer. Hopefully, there is a more permanent fix soon.

from module-packer.

DanielRuf avatar DanielRuf commented on September 28, 2024

@PiSaucer please try npm / yarn resolutions

https://www.npmjs.com/package/npm-force-resolutions

https://stackoverflow.com/questions/52416312/npm-equivalent-of-yarn-resolutions

https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

from module-packer.

floscher avatar floscher commented on September 28, 2024

Winston has fixed the issue, so their next release should work normally again: winstonjs/winston#2007

from module-packer.

PiSaucer avatar PiSaucer commented on September 28, 2024

Thank you for reporting that for me. I appreciate your time and help.

from module-packer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.