Reputation: 197
Before I post this question, I have tried all of the solution offered down below : ERROR in Cannot find module 'node-sass'
I use create-react-app to create project1 on Windows 10.
My node version : node -v -> v12.16.3
Install node-sass : npm install node-sass@latest
App.js :
import React from 'react';
import "assets/scss/style.scss";
function App() {
return (
<div>Hi World</div>
);
}
export default App;
npm start
Error on the browser : ./src/App.js Module not found: Can't resolve 'assets/scss/style.scss' in 'F:\project1\src'
I'm just wondering why isn't there a simpler and guarentee-to-work way to get this node-sass installed and run. After I searched up for solution on google, it turns out that a lot of people (not only me) are having the same problem.
Upvotes: 2
Views: 4376
Reputation: 11
https://github.com/sass/node-sass
You can install [email protected] according to your node version.
Upvotes: 1
Reputation: 13
You just need to flow three steps:
Upvotes: 0