Error message: The specified file or directory named '-stylus' could not be found

Encountered an error message while using stylus with npm on my Linux machine. After installing nodejs from GitHub, I executed the command

npm install -g stylus autoprefixer-stylus
and received the following error log:

npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/autoprefixer-stylus'
npm ERR!     at Error (native)
npm ERR!  { [Error: EACCES, unlink '/usr/local/lib/node_modules/autoprefixer-stylus']
npm ERR!   stack: 'Error: EACCES, unlink \'/usr/local/lib/node_modules/autoprefixer-stylus\'\n    at Error (native)',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/autoprefixer-stylus' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator. 

... (Additional error details)

Realized that running the command with sudo resolves the issue. However, the next output after adding sudo is:

/usr/local/bin/stylus -> /usr/local/lib/node_modules/stylus/bin/stylus

... (Dependency details)
... (More information about the output)

Attempted to run

stylus -u autoprefixer-stylus -w style.styl
but encountered another error:

/usr/local/lib/node_modules/stylus/bin/stylus:625
    if (err) throw err;
                   ^
Error: ENOENT, stat '-stylus'
    at Error (native)

Unsure of the cause of this error or if anything is missing in the process. Any insights would be appreciated.

Answer №1

It seems like you may be using an incorrect command. To properly install the stylus package, please execute the following command in your terminal:

 sudo npm install -g stylus

If you also wish to install autoprefixer-stylus, you can do so by running the following command:

 sudo npm install -g autoprefixer-stylus

Answer №2

Currently, I believe I need to have package/files on hand. I recently executed the following command: stylus -u autoperfixer -stylus -w style.styl and encountered the following issue

Correction: It should be autoprefixer-stylus, not autoperfixer -stylus.

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

Properly aligning text with checkboxes using HTML/CSS and tags like <span> or <div>

My goal is to have the text displayed as a block in alignment with the checkbox, adjusting based on the sidebar's width. For reference: Current Layout Preferred Layout I have shared the code on CodePen (taking into account screen resolution and wi ...

Is there a built-in method in Next.js 13 to secure routes from unauthorized access?

In my project, I have the following pages: /about, /user, and /user/[id]. Unfortunately, I am unable to access req.page, which provides the slug (i.e. /user/[id]), making it difficult for me to implement logic to redirect requests from unauthenticated user ...

Utilizing Promises with Multiple .then() in JavaScript

I'm currently in the process of creating an array structure. In this structure, we have different parts and each part contains articles. What I've done is create a promise to gather all the parts using .then(), then I need to iterate through eac ...

Does Angular 16 not provide support for the agm/core module?

Encountering an issue while using Angular 16 with AgmCoreModule. The error message reads: node_modules/@agm/core/lib/core.module.d.ts:25:22 [ng] 25 export declare class AgmCoreModule { [ng] ~~~~~~~~~~~~~ [ng] This indi ...

Do designers often manually adjust elements using media queries when working with Bootstrap?

Is it common practice to directly invoke media queries in order to manually adjust the layout of elements when using Bootstrap? In other words, if I have a custom element that I need to display or position in a specific way, is it acceptable to call the m ...

Using the `type=file` input in Internet Explorer 11

Encountering an issue with the input type file on IE11. In IE11, the input field is displayed as two tab-able pseudo elements (text/button). Tried using the class ::-ms-browse to hide the button with display: none, but it remains tab-able. To replicate: ...

jQuery Form Plugin - fails to trigger error callback for Internal Server errors (500)

I am dealing with a situation where my server is returning a Status code 500, but my jQuery Form is triggering the success callback instead of the error callback. My current jQuery version is 1.7.1 and jQuery Form version is 2.73 from March 2011. The serv ...

Refresh the content of VueJS Resource

Resource file helper/json_new.json { "content": { "content_body": "<a href='#' v-on:click.prevent='getLink'>{{ button }}</a>", "content_nav": "", } } Vue script.js file new Vue({ el: 'body', ...

How can you quickly navigate to the top of the page before clicking on a link in the same window/tab?

Could someone assist me with a coding issue I am facing? I would like to be able to go to the top of the page when clicking on a link and have the link open in the same tab. I attempted to implement this functionality using the following code, however, I ...

Transferring a JavaScript variable to PHP using Ajax within the same webpage

Check out my HTML and JavaScript code: <form id="form" action="javascript:void(0)"> <input type="submit" id="submit-reg" value="Register" class="submit button" onclick="showtemplate('anniversary')" style='font-family: georgia;font- ...

Choose the specific selector following the current selector

Consider this example of code: <script> $(document).ready(function () { $('span').each(function () { $(this).html('<div></div>') ; if ( $(this).attr('id') == 'W0' ...

Error: The function 'fetch' is not recognized in Selenium Console

Having some trouble with Selenium and Chrome Developer Tools. I want to open Selenium, go to a URL, and then use driver.execute_script to make a fetch request via Console in Chrome Developer Tools within the Selenium window. However, when I try to run thi ...

Having trouble retrieving the request body in Resify when communicating with Postman to transmit data

I am currently utilizing a Restify server (node version v9.11.1, restify version 6.4.0). Below is the configuration for my server: server.use(restify.plugins.queryParser({ mapParams: true })) server.use(restify.plugins.bodyParser({ mapParams: true })); s ...

Form aligned to the right

Is there a way to align the form to the right in this code? HTML @import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@500&display=swap'); * { font-family: "Noto Sans", sans-serif; font-weight: 500; } .no-outline { ...

Tips for adjusting the alignment of a navbar-brand and navbar using Bootstrap 5

I am currently using bootstrap to develop a webpage. I have a navigation bar at the top of the page and I would like my navbar-brand to be positioned on the right side, while my navbar links should be on the left. However, when I try to implement this, it ...

Is it feasible to retrieve two sets of AWS credentials from a JSON file?

  I am working on developing a node.js express application and I require the ability to access two different sets of credentials depending on the user’s context. Currently, I have configured the app to retrieve one set of credentials from a specific co ...

Removing invalid characters in a *ngFor loop eliminates any elements that do not meet the criteria

I am facing an issue with my *ngFor loop that is supposed to display a list of titles. fetchData = [{"title":"woman%20.gif"},{"title":"aman",},{"title":"jessica",},{"title":"rosh&quo ...

How can I search for a package using the "at" symbol in the NPM package API?

One way to query a package using the NPM public API is by running a command like this one for the react package: curl "https://api.npms.io/v2/package/react" This method works well and you can find more information about it at But what if you need to quer ...

Challenges faced while executing asynchronous tasks in Gulp

I am new to working with Node.js projects and have taken over one that uses Gulp for building and distribution. This project consists of multiple task files, all referenced in a single gulpfile.js. For simplicity, let's focus on the smallest function ...

Is there a way to adjust only the height of a responsive image?

Increasing the Height of an Image on a Mobile Device! I have an image that displays as the header of my website. When I resize the window to mobile format, the image resizes too. However, I want the height of the header image to be longer! Is this possibl ...