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