trivial fix, but fatal at compile time
raw error log:
23:05:02@aph> pnpm build
Lockfile is up to date, resolution step is skipped
Already up to date
Done in 601ms using pnpm v11.5.2
$ gulp clean build
[23:05:06] Using gulpfile ~/project/browser/AriaNg/gulpfile.js
[23:05:06] Starting 'clean'...
[23:05:06] Starting 'build'...
[23:05:06] Starting 'lint'...
[23:05:06] Finished 'clean' after 61 ms
[23:05:06] Finished 'lint' after 104 ms
[23:05:06] Starting 'process-fonts'...
[23:05:06] Starting 'prepare-fonts'...
[23:05:06] Finished 'prepare-fonts' after 4.13 ms
[23:05:06] Starting '<anonymous>'...
[23:05:06] Finished '<anonymous>' after 3.61 ms
[23:05:06] Finished 'process-fonts' after 8.17 ms
[23:05:06] Starting 'process-langs'...
[23:05:06] Starting 'prepare-langs'...
[23:05:06] Finished 'prepare-langs' after 4.44 ms
[23:05:06] Starting '<anonymous>'...
[23:05:06] Finished '<anonymous>' after 5.6 ms
[23:05:06] Finished 'process-langs' after 10 ms
[23:05:06] Starting 'process-assets'...
[23:05:06] Starting 'process-html'...
[23:05:06] Starting 'prepare-html'...
[23:05:06] Starting 'prepare-styles'...
[23:05:07] Finished 'prepare-styles' after 167 ms
[23:05:07] Starting 'prepare-scripts'...
[23:05:07] Finished 'prepare-scripts' after 50 ms
[23:05:07] Starting 'prepare-views'...
(node:56472) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `node --trace-deprecation ...` to show where the warning was created)
[23:05:07] Finished 'prepare-views' after 79 ms
[23:05:07] Starting '<anonymous>'...
[23:05:07] '<anonymous>' errored after 732 ms
[23:05:07] Error in plugin "gulp-cssnano"
Message:
Option safe was removed. Use parser: require("postcss-safe-parser")
Details:
domainEmitter: [object Object]
domainThrown: false
[23:05:07] 'prepare-html' errored after 1.03 s
[23:05:07] 'process-html' errored after 1.03 s
[23:05:07] 'process-assets' errored after 1.03 s
[23:05:07] 'build' errored after 1.15 s
[ELIFECYCLE] Command failed with exit code 1.
error analysis
The dependency cssnano of gulp-cssnano does not appear in package.json, so there is no strict version constraint. Later, cssnano made a breaking change by removing the safe field.
solution
-
rollback to cssnano to an old version (not recommended
)
-
modify gulpfile.js to use preset: 'default' instead of safe: true
end
in this case, I use solution 2 to solve the problem. I recommend you to use this solution.
trivial fix, but fatal at compile time
raw error log:
error analysis
The dependency
cssnanoofgulp-cssnanodoes not appear inpackage.json, so there is no strict version constraint. Later, cssnano made a breaking change by removing thesafefield.solution
rollback to
cssnanoto an old version (not recommended)
modify
gulpfile.jsto usepreset: 'default'instead ofsafe: trueend
in this case, I use solution 2 to solve the problem. I recommend you to use this solution.