javascript - npm run build 不工作:错误:找不到模块'sharp'
问题描述
startd-theme@1.0.0 构建
下一个构建
Browserslist:caniuse-lite 已过时。请运行:npx browserslist@latest --update-db
为什么你应该定期这样做:
https ://github.com/browserslist/browserslist#browsers-data-updating
(node:34672) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module /Users/vedant/Documents/nextmet/node_modules/next/node_modules/postcss/package.json 中的包解析。更新此 package.json 以使用类似“./*”的子路径模式。(node --trace-deprecation ...
用于显示警告的创建位置)
发生构建错误错误:找不到模块'sharp'需要堆栈:
- /Users/vedant/Documents/nextmet/node_modules/next/dist/build/index.js
- /Users/vedant/Documents/nextmet/node_modules/next/dist/cli/next-build.js
- /Users/vedant/Documents/nextmet/node_modules/next/dist/bin/next 在 Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) 在 Function.resolve (node:internal/modules/ cjs/helpers:100:19) 在 /Users/vedant/Documents/nextmet/node_modules/next/dist/build/index.js:11:1029 在 /Users/vedant/Documents/nextmet/node_modules/next/dist/build /tracer.js:3:360 在 NoopTracer.withSpan (/Users/vedant/Documents/nextmet/node_modules/@opentelemetry/api/build/src/trace/NoopTracer.js:47:16) 在 ProxyTracer.withSpan (/Users /vedant/Documents/nextmet/node_modules/@opentelemetry/api/build/src/trace/ProxyTracer.js:36:34) 在 traceFn (/Users/vedant/Documents/nextmet/node_modules/next/dist/build/tracer. js:3:330) 在 /Users/vedant/Documents/nextmet/node_modules/next/dist/build/index.js:11:365 在异步 /Users/vedant/Documents/nextmet/node_modules/next/dist/build/tracer.js:3:470 { 代码:'MODULE_NOT_FOUND',requireStack:[
解决方案
推荐阅读
- python - Django:如何仅获取与属于登录用户的区域匹配的记录?
- onem2m - oneM2M 中的固件更新和管理
- php - Mysql在搜索期间排除百分号 - 可重用脚本
- html - 删除表单行 symfony/twig 中的表单控件
- android - “无法加载 memtrack 模块(没有这样的文件或目录)”是什么导致了这个问题?
- fasta - 随机抽样 1/3 的基因组 .fasta
- mysql - 根据java代码没有发生MySql连接泄漏
- cakephp - Cakephp 显示应用程序状态
- javascript - django表单实时选择值字段
- php - 如何验证段落内的“文件”字段是否填写在drupal表单中?