What is the solution to the error message "cannot find specified file or directory, lstat 'scss/'"?

I am currently following a tutorial on YouTube here where the instructor is demonstrating how to run an npm script "sass" file using the terminal.
When I try executing the command npm run sass, it gives me an error message: Error: ENOENT: no such file or directory, lstat 'scss/'

I believe the issue lies with the file path or file permissions. I need to configure it properly to look in the correct directory. Here is the folder structure.
Replacing the script with:

"scripts": {
    **"sass": "echo \"Error: no test specified\" "**
  },

works fine, but when replaced with:

"scripts": {
    "sass": "node-sass -w scss/ -o dist/css/ --recursive" 
  },

it throws an error. Here is the content of package.json:

 {
  "name": "abrahem_portfolio",
  "version": "1.0.0",
  "description": "PortFolio",
  "main": "index.js",
  "scripts": {
    **"sass": "node-sass -w scss/ -o dist/css/ --recursive"**

  },
  "author": "Abrahem Gh",
  "license": "ISC",
  "dependencies": {
    "node-sass": "^4.12.0"
  }
}

The tutorial instructs that the terminal should display something like this:

[email protected] sass C:\Users\Abrahim\Abrahem_portfolio node-sass -w scss/ -o dist/css/ --recursive

However, instead of displaying as expected, it shows an error:

[email protected] sass C:\Users\Abrahim\Abrahem_portfolio node-sass -w scss/ -o dist/css/ --recursive

fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, lstat 'scss/'
    at Object.lstatSync (fs.js:845:3)
    at Object.module.exports.parseDir (C:\Users\Abrahim\Abrahem_portfolio\node_modules\sass-graph\sass-graph.js:153:10)
    at Object.watcher.reset (C:\Users\Abrahim\Abrahem_portfolio\node_modules\node-sass\lib\watcher.js:17:21)
    ...

The project structure can be seen here: https://i.sstatic.net/KG082.png

Answer №1

Upon examining your directory structure, it is evident that the

"scripts": {
    "sass": "node-sass -w scss/ -o dist/css/ --recursive" 
  },

command is searching for a folder named scss, while in your project's layout there exists a folder named sass. To resolve this issue, simply rename the sass folder to scss.

The proposed solution to rectify the error would be as follows:

"scripts": {
    "sass": "node-sass -w sass/ -o dist/css/ --recursive" 
  },

Answer №2

The functionality is now operational once the complete path has been written

"scss": "node-sass --watch public/user/assets/scss/main.scss public/user/assets/css/style.css"

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

What could be causing the error message "Error: Error serializing ___ returned from getStaticProps" to appear?

When I make a call inside getStaticProps, I keep encountering the error below and I'm struggling to understand why: Error: Error serializing `.lingo` returned from `getStaticProps` in "/". Reason: `undefined` cannot be serialized as JSON. T ...

Including an image side by side with clickable text within a list

Check out my progress here: http://jsfiddle.net/dDK6z/ I've experimented with using display:inline(-block), as well as adjusting margins, padding, and more, but I can't seem to get the image to move down or the text to move up. Does anyone have ...

Implementing Google Fonts into Next.js with the combination of Sass, CSS, and Semantic UI React

I have set up my next.config.js file with the following configuration: const withSass = require('@zeit/next-sass'); const withCss = require('@zeit/next-css'); module.exports = withSass(withCss({ webpack (config) { config.module. ...

Unable to reduce the height of the li element

Even though I've attempted to adjust the height of the lis in this section using CSS, I can't seem to shorten them as desired: I've experimented with setting a line-height, adjusting the height, ensuring that paddings and margins are set to ...

What is the best way to remove the hover effect from a specific element within a div?

I am looking to achieve a specific hover effect where the white part does not darken when hovering over a certain element within its child elements. Here is the HTML code I have: <div className= {css.searchBarDiv}> <div className={css.searchBar ...

Iterate through a JSON array in PHP and store the data into a MySQL database

I'm facing a challenge when trying to insert records into a MySQL database using PHP. I have a JSON array that looks like this: [{StudentId:236,"Monday":null,"Tuesday":"2","Wednesday":"3","Thursday":"4","Friday":null},{StudentId:237,"Monday":null,"Tu ...

Tips for applying CSS to background images

Just working with one div here <div id="particles-js" > and in my CSS, I've got this: #particles-js{ width: 100%; height: 100%; background-color: #b61924; background-image: url("../js/image.jpg"); background-size: cover; backg ...

Managing backslashes within json strings in PHP is a common challenge that many developers face

It seems like there is a strange issue occurring with json_encode and/or json_decode when trying to decode a string that was generated by json_encode: $object = new stdClass; $object->namespace = 'myCompany\package\subpackage&apo ...

Problematic response design

On my responsive website, I am utilizing the hr tag in various places. However, I have noticed that some lines appear with different thicknesses, as shown in the example below. For a demonstration, you can view a sample on this fiddle: http://fiddle.jshel ...

Reset the queue for the slideDown animation using jQuery

I am experiencing an issue with my code where multiple animation effects are running simultaneously. Specifically, when I hover over navbarli1 and then move to another li element with the same navbarli1 class, the slide-down effect is not working as expect ...

CSS: Using absolute and relative positioning within a parent element can result in elements overlapping

I want to create a box in html/css where the read more hyperlink text is positioned over the background image. The goal is to have additional text added to the description without overlapping the image. Here's an example of the current issue. Curren ...

even after uninstalling, I can still see the node versions on my Mac

After removing node from my Mac, I am still seeing the version of node and npm when typing npm -v and node -v. It's puzzling because I can't find it in my root folder. Could it be that the uninstallation didn't actually remove it? ...

Is it possible to include the term 'public' exclusively within a .ts file in a TypeScript TSLint React environment?

I'm struggling to understand why I am encountering an error in VSCode while working on a react typescript project with tslint setup. The error message states: 'public' can only be used in a .ts file. [Also, I'm wondering why I' ...

Develop a custom controller in Odoo for managing and processing a JSON file

Recently delving into the world of odoo, I decided to create a module using the scaffold command in this manner: "C:\Program Files (x86)\Odoo 11.0\python\python.exe" "C:\Program Files (x86)\Odoo 11.0\server\odoo-bin ...

Enhance the appearance of a custom checkbox component in Angular

I developed a customized toggle switch for my application and integrated it into various sections. Recently, I decided to rework it as a component. However, I am encountering an issue where the toggle switch button does not update in the view (it remains t ...

Vue Component Unit Testing: Resolving "Unexpected Identifier" Error in Jest Setup

Having just started using Jest, I wanted to run a simple unit test to make sure everything was set up correctly. However, I encountered numerous errors during compilation while troubleshooting the issues. When running the test suite, Jest successfully loc ...

Tips to ensure the div remains 100vh in height, even when empty

As I work on a simple webpage with a header, body, and footer, it's essential for me to ensure that the content takes up the entire height of the page using 100vh. However, if I only have plain text in the body section without any child tags, it ends ...

Refreshing the page is the only way to activate the jQuery function

I am currently using the $.getJSON(...) method to fetch JSON data (images) for my HTML web page. The getJSON() function is triggered once the DOM has fully loaded: $(document).ready(function() { Subsequently, I am utilizing the montage.js library to orga ...

Why are two vertical scrolls appearing on the screen simultaneously?

I utilized this method to hide the body scrollbar initially and then display it upon clicking a link: $('body').css('overflow', 'hidden'); $('#site').click(function(e) { $('#wrapper').remove(); $(& ...

Gulp command seems to have gone missing

I have run into an issue while trying to install Gulp using NPM - the gulp command is not being recognized. I followed these steps with Git Bash, running as admin on a Windows 10 system. npm install gulp-cli --global ( I attempted to run 'gulp' ...