Issue: Module 'stylelint' not found in Angular Project

I've been attempting to execute this command to validate all of the .scss files (and even tried with .css files) and I keep encountering this error.

$ stylelint "apps/**/*.scss"

It worked once before but not anymore, even after restarting my computer.

Stylelint is installed globally on my system and I have the latest version:

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:

"stylelint": "13.6.0",
"stylelint-config-standard": "20.0.0"

Thank you for any help you can provide.

Answer №1

The issue here was that in my .stylelintrc.json file, I had mistakenly referenced an extension of a package that didn't actually exist. At first, I was using sass until I realized that sticking to the standard format was just as effective.

Here's how it looked initially:

{
    "extends": "stylelint-config-sass-guidleines",
    ...
}

After making this simple change, everything started working smoothly:

{
    "extends": "stylelint-config-standard",
    ...
}

Appreciate the help!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Versatile unit equipped with interactive features

As a newcomer to Angular, I have a project in mind to create a versatile confirmation popup component that can serve multiple purposes. Whether it's for deleting or saving an entry, users will need to confirm the action with a simple popup that includ ...

Querying with Node SQLite fails to return a value

So, here's my little dilemma: I have 3 methods that need to access a database file (SQLite3). export function F_SetupDatabase(_logger: any): void export function Q_RunQuery(query: string, db: "session" | "global"): any export func ...

The Response Header for JWT in Angular2 Spring Boot is not appearing

I am encountering an issue with my Angular2 client, Angular-cli, Spring Boot 1.4.0, and jwt setup. When I sign in from my Angular2 client, I am unable to retrieve the jwt token. My security configuration is as follows: @Configuration @Order(SecurityPrope ...

Angular 2's subscribe method allows for actions to be taken in response to

There are two buttons, one of which is hidden and of type file. When the user clicks the first button, a confirmation dialog opens. Upon clicking "Ok" in the dialog, the second button should be clicked. The issue arises when all the logic in the subscribe ...

Can a unique intrinsic type be created from scratch?

Ever since template literals were introduced in Typescript (PR), we've had access to various useful functions in our types: Uppercase Lowercase Capitalize Uncapitalize For more information, refer to the official documentation. Although it may seem ...

Ways to update index.html in Angular 8.3+ based on the current environment settings

I am currently developing an application using jhipster, Spring Boot, and Angular. One challenge I am facing is setting up different public keys based on whether the app is running in a development or production environment. I have spent a considerable a ...

Uncovering the perfect body proportions using Webpack and SystemJS

In the process of developing an Angular2 library that needs to work with both SystemJS and Webpack, I encountered a situation where I had to detect the height and width in pixels of the body tag to set dimensions for child tags. However, the behavior of An ...

The offsetTop property of Angular's nativeElement always returns a value of 0

I am currently working on a menu that will automatically select the current section upon scrolling. However, I am running into an issue where I am consistently getting a value of 0 for the offsetTop of the elements. The parentElement returns a value for of ...

Updating array values using radio buttons in Angular: A step-by-step guide

I am creating an array of phone objects where each phone is assigned a role, either main or secondary. I want to be able to update the main phone using a radio button and have it reflect in my object list. Here is my code: HTML <section *ngFor="le ...

Retrieving JSON data in Angular 2

There are limited options available on SO, but it seems they are no longer viable. Angular 2 is constantly evolving... I am attempting to retrieve data from a JSON file in my project. The JSON file is named items.json. I am pondering if I can achieve th ...

Tips for creating a universal function for two interlinked types

My goal is to establish an abstract relationship between different sub-types of Message and Response, allowing for a generic function that takes a Message as input and returns a corresponding Response. Specifically, when the function is called with type Me ...

Utilizing electron as a development dependency in an Ubuntu environment

After installing electron on Ubuntu 17.10, this is the process I followed: ole@mki:~/angular-electron$ npm i --save-dev electron > <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d9bcb5bcbaadabb6b799e8f7eef7e8eb"> ...

Having trouble getting errors to display on the Input onChange event with Antd

When using Antd, I am having trouble getting errors in the onChange event. Even when there is an error in a field, I cannot see the errors while typing in that particular field. For example; https://stackblitz.com/edit/react-qurm1n?file=demo.tsx Here are ...

Establishing specific categories for a universal element

I have been working on creating an input component that functions as a custom select for enums in my application. I have tried defining them for different types using concise one-liners but have run into various typing issues. Here is what I have so far: ...

Can anyone assist me with creating a custom sorting pipe in Angular 2?

*ngFor="let match of virtual | groupby : 'gameid' I have this code snippet that uses a pipe to group by the 'gameid' field, which consists of numbers like 23342341. Now, I need help sorting this array in ascending order based on the g ...

What is the best way to delete markers from a leaflet map?

I need to remove markers from my map. I am looking to create a function that will specifically clear a marker based on its ID. I am utilizing Leaflet for the map implementation. Here is my function: public clearMarkers(): void { for (var id in this. ...

Session is not functioning properly as anticipated

import * as express from 'express'; import * as session from 'express-session'; import * as bodyParser from 'body-parser'; const app: express.Express = express(); app.use(bodyParser.json()); app.use(session({ secret: &apos ...

How is it possible for passing a number instead of a string to not result in a compilation error?

Here is some code that has caught my attention. It involves passing a number to a function that expects a string. const getGreeting: Function = (name: String): String => { return `hello, ${name}`; }; const x: number = 2 console.log(getGreeting(x)) ...

Is it possible to use @ViewChild to target an element based on its class name?

The author of this article on Creating Advanced Components demonstrates selecting an element by creating a directive first: @Directive({ selector: '.tooltip-container' }) export class TooltipContainerDirective {} Then, the author uses this d ...

HttpErrorResponse "Received a 500 OK Http failure response when accessing http://localhost:8443/gestion-centros-api/workCenters/vehicles."

I encountered an issue while attempting to fetch the list of vehicles from the API. The error message displayed indicated that I need assistance with this problem. Here is the code snippet: Code logic in the service file getAllVehicle(): Observable< ...