Q: 'async_hooks' cant be found I'm trying to bundle my js file with browserify and babel: browserify ./src/background.js > ./dist/bundle.js -t babelify
The full error message I get is: Error: Can't walk dependency graph: ENOENT: no such file or directory, lstat 'D:\prog\html\extvone\async_hooks' required by D:\prog\html\extvone\node_modules\on-finished\index.js
When I looked into on-finished\index.js I saw there was a require for require('async_hooks'), but async_hooks didn't lead to a .js file, or anything.
I tried installing all the packages to the same version with npm i and update NPM globally as mentioned here, and also intalling async_hooks with npm install.
Edit:
background.js first lines:
import PythonShell from 'python-shell'; 

const express = require('express');
const app = express();

package.json includes:
  "dependencies": {
    "express": "^4.18.2",
    "python-shell": "^3.0.1"
  },
  "devDependencies": {
    "@babel/core": "^7.20.5",
    "@babel/preset-env": "^7.20.2",
    "@types/express": "^4.17.14",
    "babelify": "^10.0.0"
  }

Versions are the following: Node -> 18.12.1 LTS 'express' -> 4.18.2
The 'express' module is the root of the problem. Without it - everything works smoothly.
Update:
As mentioned in the comments, I tried to use a node-only nodule in the browser. What I actually did is deleted all the dependency on it. In a more general note, I started using VITE instead of Browserify.
