pinojs / pino-pretty

🌲Basic prettifier for Pino log lines
MIT License
1.27k stars 150 forks source link

TypeError: createColors is not a function #320

Closed nabhan-rp closed 2 years ago

nabhan-rp commented 2 years ago

/storage/emulated/0/botwa/zbase/node_modules/pino-pretty/lib/colors.js:19 const availableColors = createColors({ useColor: true }) ^

TypeError: createColors is not a function
    at Object.<anonymous> (/storage/emulated/0/botwa/zbase/node_modules/pino-pretty/lib/colors.js:19:25)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153: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)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/storage/emulated/0/botwa/zbase/node_modules/pino-pretty/index.js:8:16)
    at Module._compile (node:internal/modules/cjs/loader:1099:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)

Node.js v17.7.2

Why solve this error? without deleting node_modules folder because I see suggestions on stackoverflow solved by delete it.

mcollina commented 2 years ago

I'm sorry I don't understand the question. How could we reproduce this problem? Could you upload your project in a github repo? Why can't you remove node_modules?

kibertoad commented 2 years ago

Sounds like you are missing a transitive dependency. Rebuilding node_modules should help.

nabhan-rp commented 2 years ago

I'm sorry I don't understand the question. How could we reproduce this problem? Could you upload your project in a github repo? Why can't you remove node_modules?

Because I build node_modules manually and I install modules modules one by one. I can't run npm install and termux can't install package automatic. I should install it manually one by one downloaded directly on termux repo website and extract in /data/data/com.termux/files/usr/ via file manager have root access.

previously I have deleted node_modules once. if I have to do it again then I've reinstalled nodejs twice and installed it manually.

mcollina commented 2 years ago

I'm sorry but we don't support this kind of setup. You made some mistake in assembling node_modules.

Kampfmoehre commented 2 years ago

For others coming here with the same problem, I fixed it with npm i --no-save colorette. With npm ls colorette I could see that there was somehow a wrong version of colorette installed. image