Closed ll21121 closed 7 months ago
are you using typescript ?
I used cool-admin template, https://show.cool-admin.com/。 vue +ts + vite
stream slicer is a very old lib I wrote a long time ago (and ditched it a long time ago for better modules like split
), anyways:
line 4 here just uses the built in nodejs util.inherits
and while it's legacy, it's not deprecated... so honestly, this shouldn't happen.
Could you try running your code using node
in command line (and nothing else no typescript or other things) see if it works?
look, everything is ok。 but how to use "import" , can you write a simple example?
this should work:
import { promisified as regedit } from 'regedit'
async function main() {
await regedit.list(...)
}
main()
import { list } from "regedit"; list([path], function(error:any, result:any){ ... })
error msg:
TypeError: $u.inherits is not a function at node_modules/stream-slicer/index.js (index.js:4:4) at __require (chunk-JEXKZRFY.js?v=6827b305:12:50) at node_modules/regedit/index.js (index.js:7:22) at __require (chunk-JEXKZRFY.js?v=6827b305:12:50) at index.js:573:1 (匿名) @ index.ts:107
I'm a back-end developer. I don't know much about this