[英]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
.我不知道为什么,因为我没有包括
jspdf
或canvg
。
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.