NodeJS 错误:找不到模块请验证package.json是否具有有效的“main”条目nuxtjs error on npm run dev

rekjcdws  于 2023-06-05  发布在  Node.js
关注(0)|答案(2)|浏览(281)

无法找到模块请验证package.json具有有效的“main”条目nuxtjs error on npm run dev
无法找到模块“/root/html/favicon. ico”。请验证package.json是否具有有效的“main”条目

at tryPackage (node:internal/modules/cjs/loader:353:19)
  at Function.Module._findPath (node:internal/modules/cjs/loader:566:18)
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at p (node_modules/jiti/dist/jiti.js:1:52925)
  at g (node_modules/jiti/dist/jiti.js:1:54200)
  at node_modules/external-editor/main/index.js:12:20
  at g (node_modules/jiti/dist/jiti.js:1:55111)
  at node_modules/inquirer/lib/prompts/editor.js:7:17
  at g (node_modules/jiti/dist/jiti.js:1:55111)
ffx8fchx

ffx8fchx1#

我得到了一个类似的错误,并通过删除node_modules和package-lock.json文件来修复它,然后运行“npm install”来安装依赖项。

alen0pnh

alen0pnh2#

以下步骤应该有所帮助
1.删除package-lock.jsonnode_modules
1.运行npm install

相关问题