Gatsby: Update V1 to V2 - Error: Cannot find module 'node-sass'

Created on 22 Nov 2018  路  2Comments  路  Source: gatsbyjs/gatsby

Description

When I try to to "yarn develop", I'm getting this error.
```ERROR Failed to compile with 14 errors 13:17:52

error in ./src/components/molecules/navigation/navigation.scss

Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Cannot find module 'node-sass'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (D:\Maral Sabbagh\Documents\Sites\maralsabbaghnode_modules\v8-compile-cache\v8-compile-cache.js:159:
20)
at Object.sassLoader (D:\Maral Sabbagh\Documents\Sites\maralsabbaghnode_modules\sass-loaderlib\loader.js:46:72
)

@ ./src/components/molecules/navigation/navigation.scss 2:14-506 21:1-42:3 22:19-511
@ ./src/components/molecules/navigation/navigation.js
@ ./src/components/molecules/navigation/index.js
@ ./src/components/molecules/index.js
@ ./src/pages/contact.js
@ ./.cache/sync-requires.js
@ ./.cache/app.js
@ multi (webpack)-hot-middleware/client.js?path=/__webpack_hmr&reload=true&overlay=false D://Maral Sabbagh//Documents//Sites//maralsabbagh//.cache//app```

I tried to upgrade every gatsby dependencies, I followed the guideline. I don't know why I have this error.
Every help will be appreciated.

question or discussion

Most helpful comment

Did you install node-sass - it was moved to peer dependency - https://www.gatsbyjs.org/packages/gatsby-plugin-sass/#v200

All 2 comments

Did you install node-sass - it was moved to peer dependency - https://www.gatsbyjs.org/packages/gatsby-plugin-sass/#v200

@pieh I installed it without the --save-dev flag, that's why I had numerous issues. I installed as a dev dependency and it works now thanks :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

hobochild picture hobochild  路  3Comments

brandonmp picture brandonmp  路  3Comments

3CordGuy picture 3CordGuy  路  3Comments

kalinchernev picture kalinchernev  路  3Comments