[英]TypeError: Cannot read properties of undefined (reading 'prototype'). Next.Js and Express
I'm trying to use express in next.js, but errors appears when I try to instantiate express:我试图在next.js中使用express,但是当我尝试实例化express时出现错误:
const express = require('express');
Errors:错误:
Module not found: Can't resolve 'async_hooks' in 'C:\Users\<user>\<project>\node_modules\on-finished'
Module not found: Can't resolve 'async_hooks' in 'C:\Users\<user>\<project>\node_modules\raw-body'
Edit notes:编辑笔记:
I've already tried npm i
我已经尝试过
npm i
I'm using node 4.19.0 and express 4.18.2.我正在使用节点 4.19.0 并表示 4.18.2。
when I run npm install -g npm@latest
, it says the operation is not permitted.当我运行
npm install -g npm@latest
时,它说不允许该操作。
Install the latest nodejs and npm version or you can run the below command安装最新的 nodejs 和 npm 版本或者你可以运行下面的命令
npm install -g npm@latest
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.