An Interest In:
Web News this Week
- April 18, 2024
- April 17, 2024
- April 16, 2024
- April 15, 2024
- April 14, 2024
- April 13, 2024
- April 12, 2024
April 23, 2021 08:42 pm GMT
Original Link: https://dev.to/andrzejkrzywda/fixing-the-node-sass-problem-in-rails-node-downgrade-helps-16lh
Fixing the node-sass problem in Rails - node downgrade helps
Today I've had one of those irritating problems with Rails that I know one day I will have again. So, future me when you google it, here is the fix, you're welcome :)
The problem shows like this during rails new new_app
node_modules/node-sass: Command failed.
and
1 error generated.make: *** [Release/obj.target/binding/src/binding.o] Error 1gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2gyp ERR! stack at ChildProcess.onExit (/Users/andrzej/apps/stimulus_infinite_scroll/node_modules/node-gyp/lib/build.js:262:23)gyp ERR! stack at ChildProcess.emit (node:events:365:28)gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)gyp ERR! System Darwin 19.6.0gyp ERR! command "/usr/local/Cellar/node/16.0.0/bin/node" "/Users/andrzej/apps/stimulus_infinite_scroll/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="gyp ERR! cwd /Users/andrzej/apps/stimulus_infinite_scroll/node_modules/node-sassgyp ERR! node -v v16.0.0gyp ERR! node-gyp -v v3.8.0gyp ERR! not ok
As you can see, the node version used is 16.0.0
. At the moment of writing this post, it's a relatively new version and not everything works fine with this.
The solution? Downgrade node.
In my case I did:
npm install -g nsudo n 14
and that's it.
A possible alternative:
brew remove nodebrew install node@14
If this helped you, let me know in the comments, so that I believe in value of such posts even more ;)
Original Link: https://dev.to/andrzejkrzywda/fixing-the-node-sass-problem-in-rails-node-downgrade-helps-16lh
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To