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