title: Create-React-App v2 with Node-SASS and CSS Modules works locally but crashes in Heroku
body: <p>I'm using Create-React-App v2 and have installed <code>node-sass</code>. I also wish to use CSS Modules so I've changed the extensions and imports to <code>.module.scss</code>. </p>
  
  <p>Note: I've imported the variables (_color.scss, _type.scss) into each component's stylesheet but it is not working so I've manually imported each needed variable to each component's stylesheet for now.  </p>
  
  <p>So now the app works locally but crashes in Heroku. <code>Heroku logs</code> states <code>build failed</code> and give 3 build output links for troubleshooting assistance. Here are the following build outputs. </p>
  
  <p>1ST BUILD OUTPUT    </p>
  
  <pre><code>-----&gt; Node.js app detected
  
  -----&gt; Creating runtime environment
  
         NPM_CONFIG_LOGLEVEL=error
         NODE_ENV=production
         NODE_MODULES_CACHE=true
         NODE_VERBOSE=false
  
  -----&gt; Installing binaries
         engines.node (package.json):  unspecified
         engines.npm (package.json):   unspecified (use default)
  
         Resolving node version 10.x...
         Downloading and installing node 10.15.3...
         Using default npm version: 6.4.1
  
  -----&gt; Restoring cache
         - node_modules
  
  -----&gt; Installing dependencies
         Installing node modules (package.json + package-lock)
         audited 36784 packages in 17.665s
         found 63 low severity vulnerabilities
           run `npm audit fix` to fix them, or `npm audit` for details
  
  -----&gt; Build
         Running build
  
         &gt; webportfolio@0.1.0 build /tmp/build_946ff21a3c8a665eda74215ba467f646
         &gt; react-scripts build
  
         Creating an optimized production build...
         Failed to compile.
  
         ./src/App.js
         Cannot find file './Components/Portfolio/Portfolio' in './src'.
  
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! webportfolio@0.1.0 build: `react-scripts build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the webportfolio@0.1.0 build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /tmp/npmcache.EQOTa/_logs/2019-03-11T23_54_27_075Z-debug.log
  -----&gt; Change to Node.js build process 
         Heroku has begun executing the "build" script defined in package.json
         during Node.js builds.
         Read more: https://devcenter.heroku.com/changelog-items/1573
  -----&gt; Build failed
  
         We're sorry this build is failing! You can troubleshoot common issues here:
         https://devcenter.heroku.com/articles/troubleshooting-node-deploys
  
         Some possible problems:
  
         - Node version not specified in package.json
           https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
  
         Love,
         Heroku
  
   !     Push rejected, failed to compile Node.js app.
   !     Push failed
  </code></pre>
  
  <p>2ND BUILD OUTPUT</p>
  
  <pre><code>-----&gt; Node.js app detected
  
  -----&gt; Creating runtime environment
  
         NPM_CONFIG_LOGLEVEL=error
         NODE_ENV=production
         NODE_MODULES_CACHE=true
         NODE_VERBOSE=false
  
  -----&gt; Installing binaries
         engines.node (package.json):  unspecified
         engines.npm (package.json):   unspecified (use default)
  
         Resolving node version 10.x...
         Downloading and installing node 10.15.3...
         Using default npm version: 6.4.1
  
  -----&gt; Restoring cache
         - node_modules
  
  -----&gt; Installing dependencies
         Installing node modules (package.json + package-lock)
         audited 36784 packages in 17.814s
         found 63 low severity vulnerabilities
           run `npm audit fix` to fix them, or `npm audit` for details
  
  -----&gt; Build
         Running build
  
         &gt; webportfolio@0.1.0 build /tmp/build_85b1987ab543478c5aee6f4728e8b330
         &gt; react-scripts build
  
         Creating an optimized production build...
         Failed to compile.
  
         ./src/App.js
         Cannot find file './Components/Portfolio/Portfolio' in './src'.
  
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! webportfolio@0.1.0 build: `react-scripts build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the webportfolio@0.1.0 build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /tmp/npmcache.htJgH/_logs/2019-03-12T00_00_58_185Z-debug.log
  -----&gt; Change to Node.js build process 
         Heroku has begun executing the "build" script defined in package.json
         during Node.js builds.
         Read more: https://devcenter.heroku.com/changelog-items/1573
  -----&gt; Build failed
  
         We're sorry this build is failing! You can troubleshoot common issues here:
         https://devcenter.heroku.com/articles/troubleshooting-node-deploys
  
         Some possible problems:
  
         - Node version not specified in package.json
           https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
  
         Love,
         Heroku
  
   !     Push rejected, failed to compile Node.js app.
   !     Push failed
  </code></pre>
  
  <p>3RD BUILD OUTPUT</p>
  
  <pre><code>-----&gt; Node.js app detected
  
  -----&gt; Creating runtime environment
  
         NPM_CONFIG_LOGLEVEL=error
         NODE_ENV=production
         NODE_MODULES_CACHE=true
         NODE_VERBOSE=false
  
  -----&gt; Installing binaries
         engines.node (package.json):  10.5.0
         engines.npm (package.json):   unspecified (use default)
  
         Resolving node version 10.5.0...
         Downloading and installing node 10.5.0...
         Using default npm version: 6.1.0
  
  -----&gt; Restoring cache
         Cached directories were not restored due to a change in version of node, npm, yarn or stack
         Module installation may take longer for this build
  
  -----&gt; Installing dependencies
         Installing node modules (package.json + package-lock)
  
         &gt; node-sass@4.11.0 install /tmp/build_17cf925c197f17907d43d6369284d804/node_modules/node-sass
         &gt; node scripts/install.js
  
         Downloading binary from https://github.com/sass/node-sass/releases/download/v4.11.0/linux-x64-64_binding.node
         Download complete
         Binary saved to /tmp/build_17cf925c197f17907d43d6369284d804/node_modules/node-sass/vendor/linux-x64-64/binding.node
         Caching binary to /tmp/npmcache.Dfkzs/node-sass/4.11.0/linux-x64-64_binding.node
  
         &gt; node-sass@4.11.0 postinstall /tmp/build_17cf925c197f17907d43d6369284d804/node_modules/node-sass
         &gt; node scripts/build.js
  
         Binary found at /tmp/build_17cf925c197f17907d43d6369284d804/node_modules/node-sass/vendor/linux-x64-64/binding.node
         Testing binary
         Binary is fine
         added 1883 packages from 750 contributors and audited 36784 packages in 39.346s
         found 63 low severity vulnerabilities
           run `npm audit fix` to fix them, or `npm audit` for details
  
  -----&gt; Build
         Running build
  
         &gt; webportfolio@0.1.0 build /tmp/build_17cf925c197f17907d43d6369284d804
         &gt; react-scripts build
  
         Creating an optimized production build...
         Failed to compile.
  
         ./src/App.js
         Cannot find file './Components/Portfolio/Portfolio' in './src'.
  
  
  npm ERR! code ELIFECYCLE
  npm ERR! errno 1
  npm ERR! webportfolio@0.1.0 build: `react-scripts build`
  npm ERR! Exit status 1
  npm ERR! 
  npm ERR! Failed at the webportfolio@0.1.0 build script.
  npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /tmp/npmcache.Dfkzs/_logs/2019-03-12T01_08_21_381Z-debug.log
  -----&gt; Change to Node.js build process 
         Heroku has begun executing the "build" script defined in package.json
         during Node.js builds.
         Read more: https://devcenter.heroku.com/changelog-items/1573
  -----&gt; Build failed
  
         We're sorry this build is failing! You can troubleshoot common issues here:
         https://devcenter.heroku.com/articles/troubleshooting-node-deploys
  
         If you're stuck, please submit a ticket so we can help:
         https://help.heroku.com/
  
         Love,
         Heroku
  
   !     Push rejected, failed to compile Node.js app.
   !     Push failed
  </code></pre>
  
  <p>Solutions I've attempted:</p>
  
  <ul>
  <li><a href="https://devcenter.heroku.com/articles/troubleshooting-node-deploys#check-your-gitignore" rel="nofollow noreferrer">https://devcenter.heroku.com/articles/troubleshooting-node-deploys#check-your-gitignore</a></li>
  <li>uninstalling the global instance of npm, then reinstalled the latest recommended-for-most users version</li>
  <li>npm rebuild node-sass</li>
  </ul>
  
  <p>I've been stuck for awhile and would really appreciate any help. Thanks in advance!</p>
  
  <p>Package installed</p>
  
  <pre><code>• Node.js v10.15.3 to /usr/local/bin/node
  • npm v6.4.1 to /usr/local/bin/npm
  </code></pre>