Error: Cannot find module 'sanitize.css/page.css'

错误信息:
Error: Cannot find module 'sanitize.css/page.css'
Require stack:
- /usr/src/node_modules/.pnpm/postcss-normalize@9.0.0/node_modules/postcss-normalize/dist/index.cjs.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._resolveFilename (/usr/src/node_modules/.pnpm/tsconfig-paths@3.14.1/node_modules/tsconfig-paths/src/register.ts:90:36)
    at resolve (/usr/src/node_modules/.pnpm/postcss-normalize@9.0.0/node_modules/postcss-normalize/dist/index.cjs.js:46:46)
    at Object.<anonymous> (/usr/src/node_modules/.pnpm/postcss-normalize@9.0.0/node_modules/postcss-normalize/dist/index.cjs.js:22:25)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)


使用了postcss-normalize 9.0.0版本,在项目构建时会出现以上错误,Cannot find module 'sanitize.css/page.css' 

处理办法:
项目中直接添加依赖,在package.json中新增:

“sanitize.css”: 12.0.1

  

参考文档:
 1、V9: Cannot find module 'sanitize.css/page.css' #62

 2、Resultions for sanitize.css #506

posted @ 2022-09-22 14:22  keRee  阅读(345)  评论(0编辑  收藏  举报