簡體   English   中英

類型錯誤:無法讀取未定義的屬性(讀取“原型”)。 Next.Js 和 Express

[英]TypeError: Cannot read properties of undefined (reading 'prototype'). Next.Js and Express

我試圖在next.js中使用express,但是當我嘗試實例化express時出現錯誤:


  const express = require('express');

錯誤:

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'

編輯筆記:

我已經嘗試過npm i

我正在使用節點 4.19.0 並表示 4.18.2。

當我運行npm install -g npm@latest時,它說不允許該操作。

安裝最新的 nodejs 和 npm 版本或者你可以運行下面的命令

npm install -g npm@latest

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM