最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - "npm run build:css " can not work, while it is ok when I run the script self - Stack Overflow

programmeradmin1浏览0评论

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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论