简体   繁体   中英

PhpStorm CSSO File Watcher: Error after save

I've installed CSS minifier as the official PhpStorm documentation suggests, but this error occurred:

cmd.exe /D /C call C:\Users\douglas\AppData\Roaming\npm\csso.cmd -i styles-rca.css -o styles-rca.min.css
C:\Users\douglas\AppData\Roaming\npm\node_modules\csso-cli\node_modules\clap\lib\index.js:1
import { basename, extname } from 'path';
   ^

SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (C:\Users\douglas\AppData\Roaming\npm\node_modules\csso-cli\lib\index.js:3:13)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

Process finished with exit code 1

Below is the config I'm using.

在此处输入图像描述 PHPStorm: 2022.2.3

csso-cli: 4.0.1

Looks similar to https://github.com/css/csso-cli/issues/28; I'd suggest downgrading csso-cli

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM