简体   繁体   English

Next.js:找不到模块:无法解析“canvg”

[英]Next.js: Module not found: Can't resolve 'canvg'

I have a next.js project and I keep getting:我有一个next.js项目,我不断得到:

error - ./node_modules/jspdf/dist/jspdf.es.min.js:458:25
Module not found: Can't resolve 'canvg'

I'm not sure why because I'm not including either jspdf or canvg .我不知道为什么,因为我没有包括jspdfcanvg

Not sure what's causing it.不确定是什么原因造成的。 Any help would be appreciated.任何帮助,将不胜感激。 I'm using material-ui if that matters.如果这很重要,我正在使用material-ui

It seems dependency error means that particular Module is missing when it's running.似乎依赖错误意味着特定模块在运行时丢失。

Run npm ls or yarn list will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.运行npm ls or yarn list将以树形结构将已安装包的所有版本及其依赖项打印到标准输出。 Then search for that particulate packages are listed or not.然后搜索是否列出了颗粒包。 Run npm ls jspdf or yarn list jspdf then you can see its list of dependencies in tree-structure.运行npm ls jspdf or yarn list jspdf然后你可以在树结构中看到它的依赖列表。

Please check your node version is updated or not ?请检查您的node版本是否更新? If not then update first.如果没有,请先更新。

Quick & Dirty way: delete package.lock or yarn.lock file and delete .node_modules folders And Then run npm install or yarn to install again. Quick & Dirty 方法:删除package.lock or yarn.lock文件并删除.node_modules文件夹,然后运行npm install or yarn再次安装。 Look at console while you installing and make sure there are no error in the installing process.安装时查看控制台,确保安装过程中没有错误。 If you saw error you better look that massages also.如果你看到错误,你最好也看看按摩。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Next.js 未找到中间件模块:无法解析“fs” - Next.js middleware Module not found: Can't resolve 'fs' 找不到模块:无法解析“fs”,Next.Js - Module not found: Can't resolve 'fs', Next.Js 未找到模块:无法在 next.js 项目中解析“../styles/global.css” - Module not found: Can't resolve '../styles/global.css' in an next.js project 在 Next.js / Webpack 5 中安装 Plaiceholder 导致:找不到模块:无法解析“child_process” - Installing Plaiceholder in Next.js / Webpack 5 causes: Module not found: Can't resolve 'child_process' 将 next.js 站点部署到 Netlify 时,如何解决“找不到模块:无法解析 [目录] 中的 [css 文件]”? - How do I resolve the "Module not found: Can't resolve [css file] in [directory]" when deploying next.js site to Netlify? 我正在尝试将 NPM package 作为插件注入到 Next.js 应用程序上,以避免出现“找不到模块:无法解析‘child_process’”错误 - I'm Trying to Inject An NPM package As A Plugin on A Next.js App to Avoid A "Module not found: Can't resolve 'child_process'" Error 构建 next.js 应用程序时出错:无法解析“下一个/头” - Error when building next.js app: Can't resolve 'next/head' 找不到模块无法解决 - Module not found can't resolve 找不到模块,无法解决 - Module not found, can't resolve 找不到输入模块:无法解析“ ./assets/app.js” - Entry module not found: Can't resolve './assets/app.js'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM