我也遇到了同样的问题
npm i autoprefixer@latest
它会在package.json
和package-lock.json
文件中自动添加需求依赖项,如下所示:
package.json
"autoprefixer": "^9.6.5",
package-lock.json
"@angular-devkit/build-angular": {
...
"dependencies": {
"autoprefixer": {
"version": "9.4.6",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.4.6.tgz",
"integrity": "sha512-Yp51mevbOEdxDUy5WjiKtpQaecqYq9OqZSL04rSoCiry7Tc5I9FEyo3bfxiTJc1DfHeKwSFCUYbBAiOQ2VGfiw==",
"dev": true,
"requires": {
"browserslist": "^4.4.1",
"caniuse-lite": "^1.0.30000929",
"normalize-range": "^0.1.2",
"num2fraction": "^1.2.2",
"postcss": "^7.0.13",
"postcss-value-parser": "^3.3.1"
}
},
...
}
...
"autoprefixer": {
"version": "9.6.5",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-9.6.5.tgz",
"integrity": "sha512-rGd50YV8LgwFQ2WQp4XzOTG69u1qQsXn0amww7tjqV5jJuNazgFKYEVItEBngyyvVITKOg20zr2V+9VsrXJQ2g==",
"requires": {
"browserslist": "^4.7.0",
"caniuse-lite": "^1.0.30000999",
"chalk": "^2.4.2",
"normalize-range": "^0.1.2",
"num2fraction": "^1.2.2",
"postcss": "^7.0.18",
"postcss-value-parser": "^4.0.2"
},
...
}