admin管理员组

文章数量:1425871

I am doing a program, I meet some question when I use the npm script with Mac system;
I have already install the node-sass globally, the package.json file is as follows: package.json
it is not work when I run "npm run build:css",while the error the system tell me is as the follow picture: the err discription but I can run the mend node-sass ./src/scss/pages/index.scss ./static/css/index.css successfully in the terminal and if I add another line like "create":"touch sun.js" to package.json, it works well when I run npm run create;

I am confused, I will be grateful if someone can give some suggestion.

I am doing a program, I meet some question when I use the npm script with Mac system;
I have already install the node-sass globally, the package.json file is as follows: package.json
it is not work when I run "npm run build:css",while the error the system tell me is as the follow picture: the err discription but I can run the mend node-sass ./src/scss/pages/index.scss ./static/css/index.css successfully in the terminal and if I add another line like "create":"touch sun.js" to package.json, it works well when I run npm run create;

I am confused, I will be grateful if someone can give some suggestion.

Share Improve this question asked Apr 29, 2016 at 14:26 sunliyingsunliying 111 gold badge1 silver badge2 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 1

It might be that the node-sass module that's installed locally in the working directory is missing dependencies, or is otherwise partially configured. Try running npm install to restore any missing dependencies.

The reason node-sass runs successfully in the terminal might be because it's running from a different (probably global) installation. Run which node-sass to find the location of the running executable..

Why do you use node-sass? Here is my script, try this:

"scripts": {
    "sass": "sass --sourcemap=none --watch resources/assets/sass:public/assets/css"
  }

If you need the source map, just delete the --sourcemap=none part, and of course, change the source and destination path.

本文标签: