`npm run build` Fails. No /dist/ folder

I’m trying to get up and running with the latest sage theme on a Win 7 pc

Running npm run build:

> sage@9.0.0-alpha.4 build C:\wamp\www\[project_folder]
> webpack --progress --config assets/build/webpack.config.js

  0% compiling 10% building modules 0/1 modules 1 active multi main            10% building modules 1/1 modules 0 active 10% building modules 1/2 modules 1 active multi customizer                  10% building modules 2/2 modules 0 active 10% building modules 2/3 modules 1 active ...[project_folder]\assets\build\public-path.js 10% building modules 2/4 modules 2 active ...emes\[project_folder]\assets\scripts\main.js 10% building modules 2/5 modules 3 active ...ritchard\assets\scripts\customizer.js 10% building modules 3/5 modules 2 active ...ritchard\assets\scripts\customizer.js 10% building modules 4/5 modules 1 active ...emes\[project_folder]\assets\scripts\main.js                                          10% building modules 5/5 modules 0 active 10% building modules 5/6 modules 1 active external "jQuery"                   10% building modules 6/6 modules 0 active 10% building modules 6/7 modules 1 active ...mes\[project_folder]\assets\styles\main.scss 10% building modules 6/8 modules 2 active ...itchard\assets\scripts\util\router.js 10% building modules 6/9 modules 3 active ...chard\assets\scripts\routes\Common.js 10% building modules 6/10 modules 4 active ...itchard\assets\scripts\routes\Home.js 10% building modules 6/11 modules 5 active ...tchard\assets\scripts\routes\About.js 10% building modules 7/11 modules 4 active ...tchard\assets\scripts\routes\About.js 10% building modules 8/11 modules 3 active ...tchard\assets\scripts\routes\About.js 11% building modules 9/11 modules 2 active ...itchard\assets\scripts\util\router.js 11% building modules 9/12 modules 3 active ...odules\bootstrap\dist\js\bootstrap.js 11% building modules 10/12 modules 2 active ...odules\bootstrap\dist\js\bootstrap.js 11% building modules 10/13 modules 3 active ...hard\assets\scripts\util\camelCase.js 11% building modules 11/13 modules 2 active ...hard\assets\scripts\util\camelCase.js 11% building modules 12/13 modules 1 active ...mes\[project_folder]\assets\styles\main.scss 11% building modules 12/14 modules 2 active ...node_modules\tether\dist\js\tether.js 11% building modules 13/14 modules 1 active ...mes\[project_folder]\assets\styles\main.scss                                          11% building modules 14/14 modules 0 active                                 71% sealing 72% optimizing 73% basic module optimization       74% module optimization 75% advanced module optimization     76% basic chunk optimization       77% chunk optimization 78% advanced chunk optimization 79% module and chunk tree optimization                    80% module reviving 81% module order optimization    82% module id optimization         83% chunk reviving 84% chunk order optimization    85% chunk id optimization               86% hashing 87% module assets processing  88% chunk assets processing 89% additional chunk assets processing                          90% recording 91% additional asset processing    92% chunk asset optimization       94% asset optimization           95% emittingHash: b12483cb844f8f911118
Version: webpack 2.1.0-beta.27
Time: 29462ms
                                    Asset     Size  Chunks             Chunk Names
                    scripts/customizer.js  3.93 kB       1  [emitted]  customizer
  vendor/fontawesome-webfont_674f50d2.eot   166 kB          [emitted]  
  vendor/fontawesome-webfont_b06871f2.ttf   166 kB          [emitted]  
vendor/fontawesome-webfont_af7ae505.woff2  77.2 kB          [emitted]  
 vendor/fontawesome-webfont_fee66e71.woff    98 kB          [emitted]  
                          scripts/main.js   162 kB       0  [emitted]  main
  vendor/fontawesome-webfont_912ec66d.svg   444 kB          [emitted]  
                          styles/main.css   222 kB       0  [emitted]  main
                      scripts/main.js.map   268 kB       0  [emitted]  main
                      styles/main.css.map   278 kB       0  [emitted]  main
                scripts/customizer.js.map  2.57 kB       1  [emitted]  customizer
                          images/logo.png  17.7 kB          [emitted]  
  [12] multi customizer 40 bytes {1} [built]
  [13] multi main 52 bytes {0} [built]
    + 12 hidden modules

ERROR in ./build/public-path.js

C:\wamp\www\[project_folder]\assets\build\public-path.js
  1:25  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  2:34  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  3:1   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  4:71  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  5:27  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  6:50  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
               7:92  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  8:2   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style

✖ 8 problems (8 errors, 0 warnings)

 @ multi main

ERROR in ./build/public-path.js
Module build failed: Error: Module failed because of a eslint error.

C:\wamp\www\[project_folder]\assets\build\public-path.js
  1:25  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  2:34  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  3:1   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  4:71  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  5:27  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  6:50  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  7:92  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  8:2   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style

✖ 8 problems (8 errors, 0 warnings)

    at lint (C:\wamp\www\[project_folder]\node_modules\eslint-loader\index.js:115:17)
    at Object.module.exports (C:\wamp\www\[project_folder]\node_modules\eslint-loader\index.js:181:3)
 @ multi main
Child extract-text-webpack-plugin:
                                        Asset     Size  Chunks             Chunk Names
      vendor/fontawesome-webfont_674f50d2.eot   166 kB          [emitted]  
      vendor/fontawesome-webfont_912ec66d.svg   444 kB          [emitted]  
      vendor/fontawesome-webfont_b06871f2.ttf   166 kB          [emitted]  
    vendor/fontawesome-webfont_af7ae505.woff2  77.2 kB          [emitted]  
     vendor/fontawesome-webfont_fee66e71.woff    98 kB          [emitted]  
        + 8 hidden modules

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\[user]\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.2
npm ERR! code ELIFECYCLE
npm ERR! sage@9.0.0-alpha.4 build: `webpack --progress --config assets/build/webpack.config.js`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the sage@9.0.0-alpha.4 build script 'webpack --progress --config assets/build/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the sage package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --progress --config assets/build/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs sage
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls sage
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\wamp\www\[project_folder]\npm-debug.log

Process finished with exit code 1 at 16:32:22.
Execution time: 62,371 ms.

npm-debug.log:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\[user]\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'build' ]
2 info using npm@4.0.2
3 info using node@v6.9.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle sage@9.0.0-alpha.4~prebuild: sage@9.0.0-alpha.4
6 silly lifecycle sage@9.0.0-alpha.4~prebuild: no script for prebuild, continuing
7 info lifecycle sage@9.0.0-alpha.4~build: sage@9.0.0-alpha.4
8 verbose lifecycle sage@9.0.0-alpha.4~build: unsafe-perm in lifecycle true
9 verbose lifecycle sage@9.0.0-alpha.4~build: PATH: C:\Users\[user]\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;C:\wamp\www\[project]\web\app\themes\[project]\node_modules\.bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\wamp\bin\php\php-5.6.20;C:\ProgramData\ComposerSetup\bin;C:\Program Files\Git\cmd;C:\Users\[user]\AppData\Roaming\Composer\vendor\bin;C:\Program Files (x86)\Skype\Phone\;C:\Program Files\TortoiseGit\bin;C:\Program Files\nodejs\;C:\Ruby23-x64\bin;C:\Users\[user]\AppData\Roaming\npm
10 verbose lifecycle sage@9.0.0-alpha.4~build: CWD: C:\wamp\www\[project]\web\app\themes\[project]
11 silly lifecycle sage@9.0.0-alpha.4~build: Args: [ '/d /s /c',
11 silly lifecycle   'webpack --progress --config assets/build/webpack.config.js' ]
12 silly lifecycle sage@9.0.0-alpha.4~build: Returned: code: 2  signal: null
13 info lifecycle sage@9.0.0-alpha.4~build: Failed to exec build script
14 verbose stack Error: sage@9.0.0-alpha.4 build: `webpack --progress --config assets/build/webpack.config.js`
14 verbose stack Exit status 2
14 verbose stack     at EventEmitter.<anonymous> (C:\Users\[user]\AppData\Roaming\npm\node_modules\npm\lib\utils\lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Users\[user]\AppData\Roaming\npm\node_modules\npm\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid sage@9.0.0-alpha.4
16 verbose cwd C:\wamp\www\[project]\web\app\themes\[project]
17 error Windows_NT 6.1.7601
18 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\[user]\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
19 error node v6.9.1
20 error npm  v4.0.2
21 error code ELIFECYCLE
22 error sage@9.0.0-alpha.4 build: `webpack --progress --config assets/build/webpack.config.js`
22 error Exit status 2
23 error Failed at the sage@9.0.0-alpha.4 build script 'webpack --progress --config assets/build/webpack.config.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the sage package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     webpack --progress --config assets/build/webpack.config.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs sage
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls sage
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

The errors are there:

  1:25  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  2:34  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  3:1   error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style
  4:71  error  Expected linebreaks to be 'LF' but found 'CRLF'  linebreak-style

Generally, if you are developing in Windows, you should make sure your IDE or text editor is saving files with the correct line endings and being consistent. Unix systems use LF, Windows uses CRLF.

The files the error refers to are shipped with Sage - I did not create them with my IDE.

I’ve decided to use Sage 8.5 instead of 9 in the meantime.

I had the same error try to add:

"rules": {
	"linebreak-style": 0
  }

in .eslintrc in the main of your theme and in assets/build .eslintrc

1 Like

Thanks @MaxSwinkels that worked.
I hope they update this soon so I don’t have to do this next time.

This is due to the editor that you use and also the system in which you work. I readed that Linux ended there linebreak different as windows but i think this is a bug of ESLINT.

I can’t be the only sucker using Windows and PHPStorm? :slight_smile:

1 Like

Unable to reproduce

I hope you realize that Sage is an open source project that is worked on in our free time and that “they” can involve you, too.

I ran some commands on the Sage repo to see if any files come with CRLF linebreaks out of the box. There are none.

Good point.
Well I don’t know how the line breaks came to be, but it’s sorted now after applying Max’s fix.

When you install Git on Windows, you can select how to handle line breaks when checking in/out of Git. The default I believe is to convert LF to CRLF on checkout, and back to LF on check-in. If you’re using the command line and using an editor which understands LF, you should really change Git to not modify line endings at all, or keep everything at LF.

Betting that’s the issue Windows users are having.