yarn icon indicating copy to clipboard operation
yarn copied to clipboard

Yarn not rebuilding node-sass

Open florian-bd opened this issue 8 years ago • 28 comments
trafficstars

Do you want to request a feature or report a bug? possibly bug

What is the current behavior? I am using yarn in my CI/CD platform yarn install then I use webpack to build my bundle I get an error at this point:

Module build failed: Error: Missing binding /mydirectory/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
Found bindings for the following environments:
  - Linux 64-bit with Node.js 4.x

I tried to run yarn cache clean first, but it didn't help. It is working if I run yarn install --force though So it seems that when yarn install is run, it doesn't rebuild node-sass. I have no idea why

If the current behavior is a bug, please provide the steps to reproduce. Will try to do that but first I wanna see if I am missing something obvious

What is the expected behavior? node-sass to be built when cache is empty and yarn install is run

florian-bd avatar Nov 06 '17 14:11 florian-bd

Which version of Yarn are you using?

BYK avatar Nov 06 '17 15:11 BYK

v1.3.2

florian-bd avatar Nov 06 '17 16:11 florian-bd

Same problem, downgraded to 1.2.1 and all works.

Alex-Torres avatar Nov 14 '17 20:11 Alex-Torres

Likewise, yarn 1.2.1 and then downgrading Node to 6.x.x worked for me.

KayakinCoder avatar Dec 15 '17 02:12 KayakinCoder

yarn install --force worked for me (just as OP said). Using Node v8.9.4.

FullstackJack avatar Jan 26 '18 18:01 FullstackJack

is this still an issue?

abhinavsingi avatar Mar 30 '18 11:03 abhinavsingi

I have this issue with yarn --ignore-scripts --pure-lockfile --frozen-lockfile in circleci. Only solution I've found is to run npm rebuild node-sass. This happens regardless of having no caches or restoring node_modules and yarn's cache from cache.

jensbodal avatar Apr 11 '18 17:04 jensbodal

This is definitely still an issue, I've been fighting with Heroku deployments all day because of it.

node v8.9.1 npm 5.6.0 yarn 1.7.0

bbugh avatar Jun 19 '18 21:06 bbugh

I have same problem. But my module is grpc-node

zyf0330 avatar Jul 12 '18 03:07 zyf0330

Not sure if my problem is related, but I run a bash console on Heroku and found out that node_modules/node-sass and node_modules/.bin/node-sass (symlink) were not there. And...

This didn't work: yarn install -D node-sass (devDependencies) 👎 This did work: yarn install node-sass (dependencies) 👍

Maybe it helps 🤷‍♂️

cris7ea avatar Jul 13 '18 07:07 cris7ea

Same problem with: Node: v10.6.0 NPM: 6.1.0 Yarn: 1.7.0

toobulkeh avatar Aug 06 '18 17:08 toobulkeh

Same problem in our CI server (using Docker image node-8-alpine) after bumping [email protected] to [email protected]: Node: v8.11.3 NPM: 5.6.0 Yarn: 1.6.0

We use the --frozen-lockfile option to install dependencies: yarn install --frozen-lockfile. The contents of folder node_modules are cached between builds.

The Problem is solved after temporary adding npm rebuild to the job or clearing node_modules.

n0v1 avatar Aug 13 '18 09:08 n0v1

Same problem on Jenkins only, using yarn 1.6.0, node 8.11.3. Workaround yarn install --force works.

muratkemaldar avatar Aug 15 '18 10:08 muratkemaldar

I had to switch from node:alpine back to node:10-alpine since Node 11 was released lately.

ferdynator avatar Nov 07 '18 08:11 ferdynator

This is an insanely persistent issue. This bug keeps reappearing randomly all the time.

AdamZaczek avatar Mar 30 '19 22:03 AdamZaczek

Same issue here, it is pain in the ass. I had this issue last year with another project and suddenly it worked, I can't even remember what I did to get it working again. Now I have the same issue in another project and it is just a god damn time eating issue. :(

node: v8.5.0 npm: 6.4.1 yarn: 1.15.2

Edit: yarn install --force did the job or one of the plenty things I've tried before. Yet another 2h gone to trial and error because this issue. 😡

burzum avatar Apr 22 '19 20:04 burzum

I had this issue. I diffed the node_modules before and after yarn install --force. The only difference was there was a file in node_modules/.cache before, and not afterwards. May I suggest clearing this directory as a first attempt at resolving the issue when it occurs again?

You would have to do rm -r node_modules/.cache as yarn cache clean appears to do something different.

I can't say yet whether this is a workaround, but if so, it's a quicker one.

robrecord avatar Jul 18 '19 21:07 robrecord

In case it helps anyone, my issue had to do with yarn workspaces. I had two frontend packages that were using node-sass but only one of them had it listed under package.json. When I pulled the other package out of the monorepo and tried to use it independently, I got the error described here. After adding it to "devDependencies", everything worked fine.

PaulRBerg avatar Aug 13 '19 20:08 PaulRBerg

After adding it to "devDependencies", everything worked fine.

I had similar issue in a CRA and Electron setup... While a yarn remove node-sass && yarn add remove-sass && prefix to my scripts fixed the problem temporarily, moving node-sass to devDependencies is the permanent solution! Thanks so much.

LucasForster avatar Oct 23 '19 08:10 LucasForster

For Rails/Webpacker/Heroku, I had to move node-sass from devDependencies to dependencies in package.json. That fixed it.

szTheory avatar Dec 28 '19 19:12 szTheory

I managed to solve this problem by removing the node_modules folder and yarn.lock files then run yarn install --force afterwards.

ranndev avatar Jan 24 '20 12:01 ranndev

yarn add node-sass did it for me!

fridzema avatar Feb 04 '20 20:02 fridzema

yarn install --force really just worked for me.

DominusKelvin avatar May 06 '20 06:05 DominusKelvin

Just on a side note:

yarn install v1.21.1
error `install` has been replaced with `add` to add new dependencies. Run "yarn add node-sass" instead.

I've experienced that problem (yarn is not pulling accurate build of node-sass) after upgrading node version.

TeoTN avatar Jun 04 '20 17:06 TeoTN

Because I will definitely find this thread again: consult the releases page and make sure your node is compatible with your node-sass: https://github.com/sass/node-sass/releases

You may need to downgrade your Node or upgrade some of your dependencies. This isn't super clear from the build failure message.

emcmanus avatar Sep 27 '20 22:09 emcmanus

I met the problem recently, and I found the problem issued inside copyModules.

After removing possibleExtraneous, yarn linked a wrong version node-sass binding file, which in my case is darwin-x64-88/binding.node. Actually, the node version I was using is 10.19.0.

jasonxia23 avatar Nov 17 '20 09:11 jasonxia23

Rebooting the computer worked for me. After that yarn install worked just fine.

iknowmagic avatar Jul 14 '22 20:07 iknowmagic

Rebooting the computer worked for me. After that yarn install worked just fine.

I think rebooting is the perfect cure for any PC problems 😁😅😆

otabekoff avatar Jul 20 '22 00:07 otabekoff