johnpapa / vue-getting-started

This project is seen in demos including the Pluralsight course "Vue: Getting Started" to help represent a fundamental app written with Vue. The heroes and villains theme is used throughout the app.
191 stars 169 forks source link

Error with Sass #106

Open malbrecht13 opened 3 years ago

malbrecht13 commented 3 years ago

In Pluralsight Vue: Getting Started course:

Section 2, Getting Started with Vue Lession: Getting and Exploring the Sample Code

I followed all instructions in the video but I encounter an error when I run the command npm run serve:

INFO Starting development server... 98% after emitting CopyPlugin

ERROR Failed to compile with 1 errors 8:53:53 PM

error in ./src/app.vue?vue&type=style&index=0&lang=scss&

Module build failed (from ./node_modules/sass-loader/lib/loader.js): Error: Cannot find module 'node-sass' Require stack:

Is this an issue because I have different versions of vue, npm, and/or node? Thanks.

klawrow commented 3 years ago

The issue is with the node-sass package. The following workaround worked for me https://stackoverflow.com/a/64626556/8383670.

klawrow commented 3 years ago

Update: After looking at the error output again, I noticed that I needed Python 2.7 and MSBuild tools installed on my Win10 machine. I installed Python 2.7.18 (https://chocolatey.org/packages/python2) and installed MSBuild (https://stackoverflow.com/a/41783879/8383670), then rebooted my machine and all worked flawlessly.

DangRock commented 3 years ago

I'm not able to get this fix to work... are you using Node 15? Sounds like node-sass less than 5.0.0 is incompatible with Node 15, so I can't downgrade to 4.12.1. I'd rather not have to uninstall Node 15 for 14 if I don't have to. Anyone have a fix? Looks like 5.0.0 node-sass is deprecated... does that mean it won't be fixed?

klawrow commented 3 years ago

I'm not able to get this fix to work... are you using Node 15? Sounds like node-sass less than 5.0.0 is incompatible with Node 15, so I can't downgrade to 4.12.1. I'd rather not have to uninstall Node 15 for 14 if I don't have to. Anyone have a fix? Looks like 5.0.0 node-sass is deprecated... does that mean it won't be fixed?

I'm using Node 14.15.2. What have you tried so far? Are you on a windows or mac? Can you paste the exact errors you're getting?

DangRock commented 3 years ago

I'm not able to get this fix to work... are you using Node 15? Sounds like node-sass less than 5.0.0 is incompatible with Node 15, so I can't downgrade to 4.12.1. I'd rather not have to uninstall Node 15 for 14 if I don't have to. Anyone have a fix? Looks like 5.0.0 node-sass is deprecated... does that mean it won't be fixed?

I'm using Node 14.15.2. What have you tired so far? Are you on a windows or mac? Can you paste the exact errors you're getting?

Think I figured out the issue... for some reason, 'npm install sass-loader' was installing sass-loader@4.0.0. When running 'npm run serve', I would get an error saying node-sass 5.0.0 incompatible with sass-loader 4.0.0. I uninstalled that and installed sass-loader@10.1.0 and then made sure I have Node 15 and node-sass 5.0.0 and everything works now.