[英]Error: Cannot find module 'stylelint' - Angular Project
I'm trying to run this command to validate all the.scss (and even the.css files I tried too) and now it's presenting me with this error.我正在尝试运行此命令来验证所有 .scss (甚至我也尝试过的 .css 文件),现在它向我展示了这个错误。
$ stylelint "apps/**/*.scss"
1 time it worked and no longer, I restarted the computer and still. 1次它工作并且不再,我重新启动计算机并且仍然。
The stylelint is also globally installed and I have the latest version: stylelint 也是全局安装的,我有最新版本:
Error: Cannot find module 'stylelint'
Require stack:
- D:\DEV\Repos\Business\mobile-app-with-angular\node_modules\stylelint-order\index.js
- C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\lib\augmentConfig.js
- C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\lib\createStylelint.js
- C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\lib\printConfig.js
- C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\lib\cli.js
- C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\bin\stylelint.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:981:15)
at Function.Module._load (internal/modules/cjs/loader.js:863:27)
at Module.require (internal/modules/cjs/loader.js:1043:19)
at require (C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\node_modules\v8-compile-cache\v8-compile-cache.js:161:20)
at Object.<anonymous> (D:\DEV\Repos\Business\panama-mobile-app\node_modules\stylelint-order\index.js:1:88)
at Module._compile (C:\Users\koalt\AppData\Roaming\npm\node_modules\stylelint\node_modules\v8-compile-cache\v8-compile-cache.js:194:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1177:10)
at Module.load (internal/modules/cjs/loader.js:1001:32)
at Function.Module._load (internal/modules/cjs/loader.js:900:14)
at Module.require (internal/modules/cjs/loader.js:1043:19)
From package.json:从 package.json:
"stylelint": "13.6.0",
"stylelint-config-standard": "20.0.0"
Thanks a lot for your answers.非常感谢你的回答。
No, the reason is that in the .stylelintrc.json file I was referencing another extension of a package that did not exist (I had initially dealt with sass until I realized that using the standard is possible).不,原因是在.stylelintrc.json文件中,我引用了不存在的 package 的另一个扩展名(我最初使用 Z1F8DC276F8040001419C64E9D18F09 处理了 Z1F8DC276F8040001419C64E9D18F09 标准)。
It was like this:是这样的:
{
"extends": "stylelint-config-sass-guidleines",
...
}
Now this was the modification and it worked:现在这是修改并且它起作用了:
{
"extends": "stylelint-config-standard",
...
}
Many thanks!非常感谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.