jeromecoupe / eleventy_starter

Eleventy (11ty) starter kit
9 stars 3 forks source link

erreur lors du build #7

Closed nlebellier closed 3 years ago

nlebellier commented 3 years ago

Bonjour Jérôme,

Suite au dm sur Twitter, voici le retour dans le terminal :

nlb@speedy MINGW64 ~/Code/jc-11tycm (master)
$ npm run build

> eleventy-starter@1.0.0 build C:\Users\nlb\Code\jc-11tycm      
> npm-run-all clean --parallel styles:prod scripts:prod eleventy

> eleventy-starter@1.0.0 clean C:\Users\nlb\Code\jc-11tycm
> rimraf './dist'

> eleventy-starter@1.0.0 styles:prod C:\Users\nlb\Code\jc-11tycm
> sass --no-source-map --style=compressed './src/assets/scss/main.scss' './dist/assets/css/main.css'

> eleventy-starter@1.0.0 scripts:prod C:\Users\nlb\Code\jc-11tycm
> webpack --config './webpack.config.js' --mode production

> eleventy-starter@1.0.0 eleventy C:\Users\nlb\Code\jc-11tycm
> npx eleventy --quiet

[webpack-cli] Failed to load 'C:\Users\nlb\Code\jc-11tycm\'.\webpack.config.js'' config
[webpack-cli] Error: Cannot find module 'C:\Users\nlb\Code\jc-11tycm\'.\webpack.config.js''
Require stack:
- C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js
- C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\bootstrap.js
- C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\bin\cli.js
- C:\Users\nlb\Code\jc-11tycm\node_modules\webpack\bin\webpack.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (C:\Users\nlb\Code\jc-11tycm\node_modules\v8-compile-cache\v8-compile-cache.js:159:20)
    at loadConfig (C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js:1158:31)
    at C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js:1245:74
    at Array.map (<anonymous>)
    at WebpackCLI.resolveConfig (C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js:1245:32)
    at WebpackCLI.createCompiler (C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js:1670:33)
    at WebpackCLI.buildCommand (C:\Users\nlb\Code\jc-11tycm\node_modules\webpack-cli\lib\webpack-cli.js:1785:31) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\nlb\\Code\\jc-11tycm\\node_modules\\webpack-cli\\lib\\webpack-cli.js',
    'C:\\Users\\nlb\\Code\\jc-11tycm\\node_modules\\webpack-cli\\lib\\bootstrap.js',
    'C:\\Users\\nlb\\Code\\jc-11tycm\\node_modules\\webpack-cli\\bin\\cli.js',
    'C:\\Users\\nlb\\Code\\jc-11tycm\\node_modules\\webpack\\bin\\webpack.js'
  ]
}
Error reading '.\src\assets\scss\main.scss': no such file or directory.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! eleventy-starter@1.0.0 scripts:prod: `webpack --config './webpack.config.js' --mode production`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the eleventy-starter@1.0.0 scripts:prod 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!     C:\Users\nlb\AppData\Roaming\npm-cache\_logs\2021-03-20T14_04_17_157Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 66
npm ERR! eleventy-starter@1.0.0 styles:prod: `sass --no-source-map --style=compressed './src/assets/scss/main.scss' './dist/assets/css/main.css'`
npm ERR! Exit status 66
npm ERR!
npm ERR! Failed at the eleventy-starter@1.0.0 styles:prod 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!     C:\Users\nlb\AppData\Roaming\npm-cache\_logs\2021-03-20T14_04_17_192Z-debug.log
ERROR: "scripts:prod" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eleventy-starter@1.0.0 build: `npm-run-all clean --parallel styles:prod scripts:prod eleventy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eleventy-starter@1.0.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!     C:\Users\nlb\AppData\Roaming\npm-cache\_logs\2021-03-20T14_04_17_423Z-debug.log

A priori il est question de module non trouvé mais lequel ?

Pour info j'ai utilisé la version eleventy 0.12.1 modifié dans le package.json sortie hier pour corriger la faille de sécurité concernant pug.

jeromecoupe commented 3 years ago

On dirait que c'est la config webpack qu'ils ne trouve pas. Si tu es sur Windows, essayer simplement de supprimer le ./ devant la config dans les scripts:

"scripts:prod": "webpack --config './webpack.config.js' --mode production",
"scripts:dev": "webpack --config './webpack.config.js' --mode development",

deviennent

"scripts:prod": "webpack --config 'webpack.config.js' --mode production",
"scripts:dev": "webpack --config 'webpack.config.js' --mode development",
jeromecoupe commented 3 years ago

Je viens de mettre à jour le package.json (paths) pour essayer d'avoir une meilleure compatibilté avec Windows. Malheureusement pas de windows pour tester donc si tu peux jeter un oeil cela m'aiderait.

nlebellier commented 3 years ago

ok merci je vais tester cela et vous redis. Juste une petite remarque sur le nom que vous avez choisi, il me semble qu'un nom plus personnel, plus identifiable serait plus facile pour les utliisateurs qui testent plusieurs "eleventy_starter", je sais pas un nom avec frites ou wafle... je m'égare. a+

nlebellier commented 3 years ago

Donc voici le retour de mon test sous Windows 10 avec npm 6.14.12 après clone de ton dépôt et npm install qui ne pose pas de problème. Par contre npm run build

nlb@webdev MINGW64 ~/code/eleventy_starter_frite (master)
$ npm run build

> eleventy-starter@1.0.0 build C:\Users\nlb\code\eleventy_starter_frite
> npm-run-all clean --parallel styles:prod scripts:prod eleventy

> eleventy-starter@1.0.0 clean C:\Users\nlb\code\eleventy_starter_frite
> rimraf dist

> eleventy-starter@1.0.0 eleventy C:\Users\nlb\code\eleventy_starter_frite
> npx eleventy --quiet

> eleventy-starter@1.0.0 scripts:prod C:\Users\nlb\code\eleventy_starter_frite
> webpack --config webpack.config.js --mode production

> eleventy-starter@1.0.0 styles:prod C:\Users\nlb\code\eleventy_starter_frite
> sass --no-source-map --style=compressed src/assets/scss/main.scss dist/assets/css/main.css

> eleventy-starter@1.0.0 poststyles:prod C:\Users\nlb\code\eleventy_starter_frite
> postcss dist/assets/css/main.css --replace --no-map --use autoprefixer cssnano

internal/modules/cjs/loader.js:883
  throw err;
  ^

Error: Cannot find module 'postcss'
Require stack:
- C:\Users\nlb\code\eleventy_starter_frite\node_modules\postcss-cli\index.js
- C:\Users\nlb\code\eleventy_starter_frite\node_modules\postcss-cli\bin\postcss
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\nlb\code\eleventy_starter_frite\node_modules\postcss-cli\index.js:14:17)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\nlb\\code\\eleventy_starter_frite\\node_modules\\postcss-cli\\index.js',
    'C:\\Users\\nlb\\code\\eleventy_starter_frite\\node_modules\\postcss-cli\\bin\\postcss'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eleventy-starter@1.0.0 poststyles:prod: `postcss dist/assets/css/main.css --replace --no-map --use autoprefixer cssnano`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eleventy-starter@1.0.0 poststyles:prod 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!     C:\Users\nlb\AppData\Roaming\npm-cache\_logs\2021-04-09T12_32_01_984Z-debug.log
ERROR: "styles:prod" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! eleventy-starter@1.0.0 build: `npm-run-all clean --parallel styles:prod scripts:prod eleventy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the eleventy-starter@1.0.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!     C:\Users\nlb\AppData\Roaming\npm-cache\_logs\2021-04-09T12_32_03_888Z-debug.log

Voilà voilà

nlebellier commented 3 years ago

Du coup j'ai installé postcss

npm install postcss -save-dev et désormais ça marche :-)

jeromecoupe commented 3 years ago

yup

jeromecoupe commented 3 years ago

Fixed de mon côté. Sorry