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 badges2 Answers
Reset to default 1It 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.
本文标签:
版权声明:本文标题:javascript - "npm run build:css " can not work, while it is ok when I run the script self - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745458307a2659206.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论