Node-sass is not recognized by command line

后端 未结 5 1828
情深已故
情深已故 2021-02-07 14:16

I\'m trying to set up node-sass, following the instructions on CSS-Tricks. Node and npm are installed correctly, and the node-sass installation worked too. When I go to run

5条回答
  •  滥情空心
    2021-02-07 14:26

    You need to install it globally

    npm install -g node-sass
    

    Or add it in package.json

    "devDependencies": {
        "node-sass": "4.5.0"
    },
    "scripts" : {
        "node-sass": "node-sass --output-style compressed -o dist/css src/scss"
    }
    

    And then do
    1. npm i, which in this case would be similar to npm install --save-dev node-sass
    2. npm run node-sass

    Reference: npm scripts, npm-run-scripts

提交回复
热议问题