Я установил меньше, и это плагин clean-css через npm. Но когда я пытаюсь собрать CSS с помощью командной строки, я всегда получаю сообщение, что плагин clean-css не может быть найден.
Я пытался удалить и переустановить оба пакета. Но ошибка продолжает появляться.
Что я сделал:
Я установил less и less-plugin-clean-css через npm:
npm install less -g
npm install less-plugin-clean-css -g
Я проверил установленные пакеты:
C: \ Users \ MyUserName \ AppData \ Roaming \ НПМ
+-- less@3.8.1
| +-- clone@2.1.2
| +-- errno@0.1.7
| | `-- prr@1.0.1
| +-- graceful-fs@4.2.0
| +-- image-size@0.5.5
| +-- mime@1.6.0
| +-- mkdirp@0.5.1
| | `-- minimist@0.0.8
| +-- promise@7.3.1
| | `-- asap@2.0.6
| +-- request@2.88.0
| | +-- aws-sign2@0.7.0
| | +-- aws4@1.8.0
| | +-- caseless@0.12.0
| | +-- combined-stream@1.0.8
| | | `-- delayed-stream@1.0.0
| | +-- extend@3.0.2
| | +-- forever-agent@0.6.1
| | +-- form-data@2.3.3
| | | +-- asynckit@0.4.0
| | | +-- combined-stream@1.0.8 deduped
| | | `-- mime-types@2.1.24 deduped
| | +-- har-validator@5.1.3
| | | +-- ajv@6.10.1
| | | | +-- fast-deep-equal@2.0.1
| | | | +-- fast-json-stable-stringify@2.0.0
| | | | +-- json-schema-traverse@0.4.1
| | | | `-- uri-js@4.2.2
| | | | `-- punycode@2.1.1
| | | `-- har-schema@2.0.0
| | +-- http-signature@1.2.0
| | | +-- assert-plus@1.0.0
| | | +-- jsprim@1.4.1
| | | | +-- assert-plus@1.0.0 deduped
| | | | +-- extsprintf@1.3.0
| | | | +-- json-schema@0.2.3
| | | | `-- verror@1.10.0
| | | | +-- assert-plus@1.0.0 deduped
| | | | +-- core-util-is@1.0.2
| | | | `-- extsprintf@1.3.0 deduped
| | | `-- sshpk@1.16.1
| | | +-- asn1@0.2.4
| | | | `-- safer-buffer@2.1.2 deduped
| | | +-- assert-plus@1.0.0 deduped
| | | +-- bcrypt-pbkdf@1.0.2
| | | | `-- tweetnacl@0.14.5 deduped
| | | +-- dashdash@1.14.1
| | | | `-- assert-plus@1.0.0 deduped
| | | +-- ecc-jsbn@0.1.2
| | | | +-- jsbn@0.1.1 deduped
| | | | `-- safer-buffer@2.1.2 deduped
| | | +-- getpass@0.1.7
| | | | `-- assert-plus@1.0.0 deduped
| | | +-- jsbn@0.1.1
| | | +-- safer-buffer@2.1.2
| | | `-- tweetnacl@0.14.5
| | +-- is-typedarray@1.0.0
| | +-- isstream@0.1.2
| | +-- json-stringify-safe@5.0.1
| | +-- mime-types@2.1.24
| | | `-- mime-db@1.40.0
| | +-- oauth-sign@0.9.0
| | +-- performance-now@2.1.0
| | +-- qs@6.5.2
| | +-- safe-buffer@5.2.0
| | +-- tough-cookie@2.4.3
| | | +-- psl@1.2.0
| | | `-- punycode@1.4.1
| | +-- tunnel-agent@0.6.0
| | | `-- safe-buffer@5.2.0 deduped
| | `-- uuid@3.3.2
| `-- source-map@0.6.1
+-- less-plugin-clean-css@1.5.1
| `-- clean-css@3.4.28
| +-- commander@2.8.1
| | `-- graceful-readlink@1.0.1
| `-- source-map@0.4.4
| `-- amdefine@1.0.1
Тогда я запустил следующее:
lessc less/screen.default.less "css/screen.min.css"
Работало как задумано.
Когда я бегу ...
lessc less/screen.default.less "css/screen.min.css" --clean-css="--s1 --advanced --compatibility=ie8"
... я получаю
Unable to load plugin clean-css please make sure that it is installed under or at the same level as less
Что я делаю не так?