node-sass: Error: Module did not self-register

I’m in the process of upgrading my team’s project to webpack 2, and I’m now encountering numerous “Module did not self-register” errors for .scss files, both locally and in our build system. Example errors for one file:

ERROR in c:/Agents/01/_work/1/s/obj/framework/owa-application/lib/styles/globalstyles.global.scss
Module build failed: ModuleBuildError: Module build failed: Error: Module did not self-register.
    at Error (native)
    at Object.Module._extensions..node (module.js:597:18)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at module.exports (C:\Agents\01\_work\1\s\node_modules\node-sass\lib\binding.js:19:10)
    at Object.<anonymous> (C:\Agents\01\_work\1\s\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (module.js:570:32)
    at C:\Agents\01\_work\1\s\node_modules\webpack\lib\NormalModule.js:141:35
    at C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:364:11
    at C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:170:18
    at loadLoader (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\loadLoader.js:27:11)
    at iteratePitchingLoaders (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at iteratePitchingLoaders (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:165:10)
    at C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:173:18
    at loadLoader (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\loadLoader.js:36:3)
    at iteratePitchingLoaders (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:169:2)
    at iteratePitchingLoaders (C:\Agents\01\_work\1\s\node_modules\loader-runner\lib\LoaderRunner.js:165:10)

ERROR in C:\Agents\01\_work\1\s\node_modules\extract-text-webpack-plugin\loader.js??ref--1-0!C:\Agents\01\_work\1\s\node_modules\style-loader\index.js!C:\Agents\01\_work\1\s\node_modules\css-loader\index.js?minimize!C:\Agents\01\_work\1\s\node_modules\postcss-loader\index.js??ref--1-3!C:\Agents\01\_work\1\s\node_modules\sass-loader\lib\loader.js!c:\Agents\01\_work\1\s\obj\framework\owa-application\lib\styles\globalstyles.global.scss doesn't export content

ERROR in C:\Agents\01\_work\1\s\node_modules\extract-text-webpack-plugin\loader.js??ref--1-0!C:\Agents\01\_work\1\s\node_modules\style-loader\index.js!C:\Agents\01\_work\1\s\node_modules\css-loader\index.js?minimize!C:\Agents\01\_work\1\s\node_modules\postcss-loader\index.js??ref--1-3!C:\Agents\01\_work\1\s\node_modules\sass-loader\lib\loader.js!c:\Agents\01\_work\1\s\obj\framework\owa-application\lib\styles\globalstyles.global.scss doesn't export content

ERROR in C:\Agents\01\_work\1\s\node_modules\extract-text-webpack-plugin\loader.js??ref--1-0!C:\Agents\01\_work\1\s\node_modules\style-loader\index.js!C:\Agents\01\_work\1\s\node_modules\css-loader\index.js?minimize!C:\Agents\01\_work\1\s\node_modules\postcss-loader\index.js??ref--1-3!C:\Agents\01\_work\1\s\node_modules\sass-loader\lib\loader.js!c:\Agents\01\_work\1\s\obj\framework\owa-application\lib\styles\globalstyles.global.scss doesn't export content

ERROR in C:\Agents\01\_work\1\s\node_modules\extract-text-webpack-plugin\loader.js??ref--1-0!C:\Agents\01\_work\1\s\node_modules\style-loader\index.js!C:\Agents\01\_work\1\s\node_modules\css-loader\index.js?minimize!C:\Agents\01\_work\1\s\node_modules\postcss-loader\index.js??ref--1-3!C:\Agents\01\_work\1\s\node_modules\sass-loader\lib\loader.js!c:\Agents\01\_work\1\s\obj\framework\owa-application\lib\styles\globalstyles.global.scss doesn't export content
    
Child extract-text-webpack-plugin:
ERROR in ./~/css-loader?minimize!./~/postcss-loader?{"plugins":[null,null]}!./~/sass-loader/lib/loader.js!c:/Agents/01/_work/1/s/obj/framework/owa-application/lib/styles/globalstyles.global.scss
    Module build failed: Error: Module did not self-register.
        at Error (native)
        at Object.Module._extensions..node (module.js:597:18)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
        at Function.Module._load (module.js:438:3)
        at Module.require (module.js:497:17)
        at require (internal/module.js:20:19)
        at module.exports (C:\Agents\01\_work\1\s\node_modules\node-sass\lib\binding.js:19:10)
        at Object.<anonymous> (C:\Agents\01\_work\1\s\node_modules\node-sass\lib\index.js:14:35)
        at Module._compile (module.js:570:32)

When I search for the error, I find issues opened ~2 years ago that have all allegedly been fixed since, but nothing more recently. I’ve followed the Troubleshooting guide, and tried such suggestions as doing a clean npm install (which our build system does anyway) and running npm rebuild, to no avail.

  • NPM version (npm -v): 3.10.10
  • Node version (node -v): v6.9.5
  • Node Process (node -p process.versions):
    { http_parser: '2.7.0',
      node: '6.9.5',
      v8: '5.1.281.89',
      uv: '1.9.1',
      zlib: '1.2.8',
      ares: '1.10.1-DEV',
      icu: '57.1',
      modules: '48',
      openssl: '1.0.2k' }
  • Node Platform (node -p process.platform): win32
  • Node architecture (node -p process.arch): x64
  • node-sass version (node -p "require('node-sass').info"):
node-sass       4.5.0   (Wrapper)       [JavaScript]
libsass         3.5.0.beta.2    (Sass Compiler) [C/C++]
  • npm node-sass versions (npm ls node-sass): node-sass@4.5.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 24 (18 by maintainers)

Commits related to this issue

Most upvoted comments

omfg, how much of a cluster#$^@# is this library? I’ve been wasting over 4 hours going through issues on here. First I get environment related errors. Then I’m getting libvips not found errors. I follow instructions on thread after thread. One says to use some other person’s script to compile libvips for lambda. I try it, it’s looking for some bootstrap.sh file and fails - can’t find bootstrap.sh on the provided link - no instructions on where to find it or how to create it. Then I find another issue where it’s suggested to use a docker command to install the library. I do that command, and now I’m getting “module does not self register” I see some other instructions on running something called nw-gyp but it includes a bracketed parameter with absolutely no instructions on what you’re supposed to fill in for the bracketed parameter outside of ‘your version’ whatever the @#$^@#$^ that is. The third command in that suggestion seems to be suggesting it’s run from within node_modules/sharp (as there is a cd node_modules/sharp just above it) but refers to node_modules/sharp/install/dll-copy path as though you’re two directories up. Meanwhile, there is no dll-copy in node_modules/sharp/install – is that supposed to mean dll-copy.js??

Is there a succinct “do this to run our library on lambda” step by step that does not have ambiguous and non-descript ‘fill in the blanks’ with no clue on how to ‘fill in the blanks’ or do I chock this up to yet another library that has documentation that is @#$%@%^ and find something else to resize my images on lambda?

Apologies I have missed the update on this issue. I’ll take another look this weekend.