-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Constantly have to rebuild node-sass #1918
Comments
There are a lot of known issue with yarn, as a result we cannot officially support it. Please try using to npm to see if the issue persists. If it does not please open an issue with yarn. |
Same problem. My solution is just to run |
@skylarmb are you also using yarn? If so please try npm. |
@xzyfer yes we use yarn. We have no plan to use npm until the day it utilizes a lockfile like yarn does. For now just running |
@skylarmb I understand. I'm simply asking if you can confirm the problem doesn't exist with npm so we can confirm it's a yarn issue. |
Also having this issue, quite curious as to why this is the only package that I have this issue with when using yarn. |
At the risk of saying this too soon, I think #1185 fixes this (in release 4.5.1). I was using an older version, but since upgrading this hasn't cropped up. Not that I've had extensive time to test it as that release came out 13 hours ago :) UPDATE: I was far too hopeful and eager there. Still running |
Every time I add/remove a package with yarn 0.21.3 on macOS |
Closing since the general yarn issues are tracked in #1804 |
I frequently have this issue, and I don't use yarn, therefore I would suggest that the ticket is closed prematurely and may not be yarn specific. |
`Error: Missing binding /Library/WebServer/Documents/hod/pttg-sprint/node_modules/node-sass/vendor/darwin-x64-51/binding.node Found bindings for the following environments:
This usually happens because your environment has changed since running |
I think the error is self explanatory. You have both node 4 and 7
installed, and you're switching between the two. You need to run rebuild to
fetch the binary when you switch node versions. If you remove your node
modules you'll also need to rebuild to fetch the binary.
…On 4 May 2017 12:17 pm, "Stuart Craigen" ***@***.***> wrote:
`Error: Missing binding /Library/WebServer/Documents/
hod/pttg-sprint/node_modules/node-sass/vendor/darwin-x64-51/binding.node
Node Sass could not find a binding for your current environment: OS X
64-bit with Node.js 7.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 4.x
This usually happens because your environment has changed since running npm
install.
Run npm rebuild node-sass to build the binding for your current
environment.
at module.exports (/Library/WebServer/Documents/
hod/pttg-sprint/node_modules/node-sass/lib/binding.js:15:13)
at Object. (/Library/WebServer/Documents/hod/pttg-sprint/node_modules/
node-sass/lib/index.js:14:35)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/Library/WebServer/Documents/hod/pttg-sprint/node_modules/
gulp-sass/index.js:187:21)`
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1918 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWBpU8gd3gvjxsrzulAhhNMgwsLnYks5r2aWxgaJpZM4MUck->
.
|
@xzyfer thanks, but I don't switch between node versions, I'm always in node 7.x when I have to rebuild node-sass and it's never very long before it complains of the same issue again. Is there something different about this module compared to with others? This is the only npm module that asks to be rebuilt. |
Yes node-sass is different to most packages. In order to be fast it is a
native add-on, which means it's mostly c++ with a little bit of JavaScript.
Because it's c++ it need to be compiled against a specific node version.
This is why you need to rebuild when you change node versions.
If you are seeing that error message you are definitely changing node
versions. How/why the version is changing might not be clear. This often
happens with IDEs or editors that have some node extension installed which
is bundled with its own node runtime. This is common in visual studio for
instance.
…On 4 May 2017 12:47 pm, "Stuart Craigen" ***@***.***> wrote:
@xzyfer <https://github.com/xzyfer> thanks, but I don't switch between
node versions, I'm always in node 7.x when I have to rebuild node-sass and
it's never very long before it complains of the same issue again. Is there
something different about this module compared to with others? This is the
only npm module that asks to be rebuilt.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1918 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWHL1dODU406owVdNWuaD_Fs95Kgqks5r2ay5gaJpZM4MUck->
.
|
@hod-shcraigen as @xzyfer said, it is clear what is happening. Can you provide the output of the troubleshooting commands as the OP did? Do you have nvm installed? If nothing explains, just scan you whole filesystem with something like "find / -name node -print -exec {} -v" (haven't tested) and see where your different node engines come from. |
Building with CI this is frustrating compiling for every deployment. Is it possible to install and compile it when I build my docker image? Is it possible to install node-sass globally and compile it, so my deployments don't require a build from scratch? |
Looks like you've mounted node_modules from OSX into your container. You
need to run a clean npm install inside the container.
…On 21 Aug. 2017 11:46 pm, "ajv" ***@***.***> wrote:
Node-sass also requires a rebuild when running npm install in an Alpine
Node-8.4+ container, which is weird, since it should have its environment
binding according to the OS it was downloaded in, no?
Using node-sass v4.5.3
Module build failed: Error: Missing binding /usr/src/app/node_modules/node-sass/vendor/linux_musl-x64-57/binding.node
web_1 | Node Sass could not find a binding for your current environment: Linux/musl 64-bit with Node.js 8.x
web_1 |
web_1 | Found bindings for the following environments:
web_1 | - OS X 64-bit with Node.js 8.x
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1918 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAjZWDFgFSZz_X4d0BlJH0hZOctK87Xtks5saYoggaJpZM4MUck->
.
|
Hey, i have the same problem. I wondered: as we all know our target environments (linux docker container, for me), i'd like to be able to download the package directly, then copy it into |
I wonder if this issue should be re-opened with the amount of people that are experiencing it. I also ended up here after I attempted to upgrade from node v7.10.1 to node v8.6.0 with npm v5.3.0. Now on every npm install (after clearing the node modules folder) it seems libsass has to get rebuilt. Strange how it only seems to be an issue after the upgrade. UPDATE: Sorry for the noise, my issue was solve by updating to the latest node-sass (4.5.3) and with that I was able to DL the pre-built version, should have tried to do that first. I have always used npm though, can't speak for yarn folks.
Cut off output after |
My team uses volumes to serve code from macOS into an Ubuntu-based Docker environment. To make sure we have the correct node-sass binary, we run this script as a pre-build hook:
Hope it helps! |
Having the same issue, any updates? |
Same here. Upgrade node-sass and other dependent packages fix the problem. |
For anyone else having this problem with Docker and Docker Compose on Mac OS X, here's how I solved it. You can solve the problem once per run by running To solve the issue permanently (or at least until you change things), copy the docker os node-sass binary to your application, so that the volume has it on startup. After running the webpacker container, and running Another easier way to solve this permanently is ensuring your webpacker service mounts your app in it's volume. You could then skip the docker cp command. This is what my webpacker service looks like in docker-compose.yml
Hope that helps. |
This issue is reference very old versions of node-sass, and bugs that have since been fixed in yarn and npm. Please open a new issue if you are encounter similar problems. |
Hi all, I'm having difficulties working with node-sass. I'm using it via the sass-loader in Webpack 2. Every other day when running webpack to compile my app. I'm getting this error below.
The only thing that solves this error is running
npm rebuild node-sass
this phenomenon is happening on my machine as well as many of my coworkers. All of us have slightly different node environments as well although we're all using yarn as our package manager.0.20.3
):6.10.0
):darwin
):x64
):4.5.0
):The text was updated successfully, but these errors were encountered: