problem generating css with node-sass

1

To add the conversion from sass to css on my node I followed the steps of this tutorial , after completing it my file package.json looks like this:

{
  "name": "kimera",
  "version": "0.4.4",
  "description": "A Modern CSS and JS framework based on flexbox and custom tags",
  "main": "css/kimera.css",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "scss": "node-sass -watch scss -o css"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/JorgeAntrax/kimera.git"
  },
  "keywords": [
    "css",
    "scss",
    "flexbox",
    "responsive",
    "framework",
    "modular",
    "library",
    "etiquetas",
    "html5",
    "css3",
    "grid",
    "libreria css",
    "plantillas"
  ],
  "author": "Leonardo Quintana Juarez",
  "email": "[email protected]",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/JorgeAntrax/kimera/issues"
  },
  "homepage": "http://kimera.comli.com",
  "dependencies": {
    "@types/jquery": "^3.3.1",
    "@types/npm": "^2.0.29",
    "chai": "^4.1.2",
    "mocha": "^5.0.5",
    "node-sass": "^4.8.3"
  }
}

If you need here you can find my package-lock.json .

The problem is that when trying to run npm run scss I get the following error:

  

path.js: 28

     

throw new TypeError ('Path must be a string. Received' + inspect (path));

My versions of npm and node are ...

npm -version

5.5.1

node -v

v8.9.1

What should I change to make it work?

    
asked by Ruslan López 24.03.2018 в 09:33
source

1 answer

2

Install the node-sass again with this version

npm install [email protected]

If you experience any problems at the time of installation, try the following

npm rebuild [email protected] --force

If this keeps giving you trouble, node-sass will guide you to do it manually.

Go to the github repository: link

proceed to download or clone the repository, then unzip and you will fear the node-sass directory locate it or replace it in your project in the node-modules directory

In your package-lock.json file locate and replace with the following:

"node-sass": {
  "version": "4.7.2",
  "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.7.2.tgz",
  "integrity": "sha512-CaV+wLqZ7//Jdom5aUFCpGNoECd7BbNhjuwdsX/LkXBrHl8eb1Wjw4HvWqcFvhr5KuNgAk8i/myf/MQ1YYeroA==",
  "dev": true,
  "requires": {
    "async-foreach": "0.1.3",
    "chalk": "1.1.3",
    "cross-spawn": "3.0.1",
    "gaze": "1.1.2",
    "get-stdin": "4.0.1",
    "glob": "7.1.2",
    "in-publish": "2.0.0",
    "lodash.assign": "4.2.0",
    "lodash.clonedeep": "4.5.0",
    "lodash.mergewith": "4.6.1",
    "meow": "3.7.0",
    "mkdirp": "0.5.1",
    "nan": "2.8.0",
    "node-gyp": "3.6.2",
    "npmlog": "4.1.2",
    "request": "2.79.0",
    "sass-graph": "2.2.4",
    "stdout-stream": "1.4.0",
    "true-case-path": "1.0.2"
  }

and this should not generate any problem, in case you want to rebuild the node-sass library I invite you to review the README.md node-sass in the section ## Rebuilding binaries. I show it for the interest of any reader:

## Rebuilding binaries

Node-sass includes pre-compiled binaries for popular platforms, to add a binary for your platform follow these steps:

Check out the project:

'''bash
git clone --recursive https://github.com/sass/node-sass.git
cd node-sass
npm install
node scripts/build -f  # use -d switch for debug release
# if succeeded, it will generate and move
# the binary in vendor directory.
'''
    
answered by 26.03.2018 в 17:54