Javascript 构建失败:`npm rebuild node-sass --force`
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/53125291/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Build Fails: `npm rebuild node-sass --force`
提问by GN.
Using nto switch Node versions.
I've ran yarn, npm rebuild node-sass --forcemany many times. And still fails. Getting this error:
使用n切换节点版本。我碰到yarn,npm rebuild node-sass --force很多很多次。而且还是失败了。收到此错误:
Node Sass could not find a binding for your current environment
Node Sass could not find a binding for your current environment
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
Anyone have any idea how to fix?
任何人都知道如何解决?
Also.. When running this command..
另外..运行此命令时..
npm rebuild node-sass --force
I get..
我得到..
npm WARN using --force I sure hope you know what you are doing.
Doens't seem like it is doing anything..
好像什么都没做。。
回答by user2240097
remove node-sassfrom your command and just run npm rebuild --force
node-sass从您的命令中删除并运行npm rebuild --force
回答by Fatimah
If npm rebuild node-sassand npm rebuild node-sass --forcedoesn't work. Just uninstall node-sass and install again.
如果npm rebuild node-sass并且npm rebuild node-sass --force不起作用。只需卸载 node-sass 并重新安装。
回答by Adnan Sheikh
I just ran the command npm install node-sassand my issue was resolved.
我刚刚运行了命令npm install node-sass,我的问题就解决了。
回答by Anusuya Goud
I have tried all options like:
我已经尝试了所有选项,例如:
npm rebuild --force
npm rebuild node-sass --force
npm rebuild node-sass &
also did try to install through Python & updated VS Project links, but nothing worked..
也尝试通过 Python 和更新的 VS 项目链接进行安装,但没有任何效果..
EXCEPTrunning it manually:
除了手动运行它:
node node_modules/node-sass/scripts/install.js
回答by Mujibur Rehman Ansari
The main issue is that your node-sassand node-npmversions are in-compatible.
主要问题是您的node-sass和node-npm版本不兼容。
Please see the chart on thissite or on this.
So my suggestion is either adjust your node-npmversion or adjust node-sass.
所以我的建议是调整您的node-npm版本或调整node-sass.
In my case I was using node-sassof version 4.9.4with node version 8.12.0and npm version 6.4.1, It was working fine without any issue, later on I got new system and I had installed the latest node(12.16.0) & npm(6.13.4) and issue started so I dig into this and found above links.
在我的情况下,我使用的node-sass是4.9.4带有 node version8.12.0和 npm version 的版本6.4.1,它运行良好,没有任何问题,后来我有了新系统,我安装了最新的 node( 12.16.0) 和 npm( 6.13.4) 并且问题开始了,所以我深入研究了这个并找到上面的链接。
Hope this will help you.
希望这会帮助你。
回答by Abhi Patel
try this, add/modify your package.json
试试这个,添加/修改你的 package.json
"node-sass": "*",
and run
并运行
npm install

