dirkolbrich / hugo-tailwindcss-starter-theme

Starter files for a Hugo theme with Tailwindcss
MIT License
402 stars 55 forks source link

Build failures :( #5

Closed chris-79 closed 5 years ago

chris-79 commented 5 years ago

Works fine on my local machine, but…

Build failure on Netlify.com:

Build script:

npm i -g postcss-cli &&
npm i -g autoprefixer &&
cd themes/tailwind &&
npm install &&
cd .. &&
hugo --minify

Result:

Building sites …
{ Error: Cannot find module 'node-releases/data/processed/envs.json'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/opt/build/repo/themes/tailwind/node_modules/browserslist/index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3) code: 'MODULE_NOT_FOUND' }

Build failure on Gitlab.com CI Pipelines:

Build script:

.gitlab-ci.yml

stages:
  - build

build:
  stage: build
  only:
    - master

  image: node:latest

  variables:
    GIT_SUBMODULE_STRATEGY: recursive

  before_script:
    - npm i -g postcss-cli
    - npm i -g autoprefixer
    - cd themes/tailwind
    - npm install
    - cd ..
  script:
    - hugo --minify

Result:

Building sites … Error: Cannot find module 'node-releases/data/processed/envs.json'
Require stack:
- /builds/uga-coe/coe-people-hugo/themes/tailwind/node_modules/browserslist/index.js
- /builds/uga-coe/coe-people-hugo/themes/tailwind/node_modules/autoprefixer/lib/autoprefixer.js
- /builds/uga-coe/coe-people-hugo/themes/tailwind/assets/css/postcss.config.js
- /usr/local/lib/node_modules/postcss-cli/node_modules/import-fresh/index.js
- /usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/loaders.js
- /usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/createExplorer.js
- /usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/index.js
- /usr/local/lib/node_modules/postcss-cli/node_modules/postcss-load-config/src/index.js
- /usr/local/lib/node_modules/postcss-cli/index.js
- /usr/local/lib/node_modules/postcss-cli/bin/postcss
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:794:15)
    at Function.Module._load (internal/modules/cjs/loader.js:687:27)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/builds/uga-coe/coe-people-hugo/themes/tailwind/node_modules/browserslist/index.js:1:18)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/builds/uga-coe/coe-people-hugo/themes/tailwind/node_modules/browserslist/index.js',
    '/builds/uga-coe/coe-people-hugo/themes/tailwind/node_modules/autoprefixer/lib/autoprefixer.js',
    '/builds/uga-coe/coe-people-hugo/themes/tailwind/assets/css/postcss.config.js',
    '/usr/local/lib/node_modules/postcss-cli/node_modules/import-fresh/index.js',
    '/usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/loaders.js',
    '/usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/createExplorer.js',
    '/usr/local/lib/node_modules/postcss-cli/node_modules/cosmiconfig/dist/index.js',
    '/usr/local/lib/node_modules/postcss-cli/node_modules/postcss-load-config/src/index.js',
    '/usr/local/lib/node_modules/postcss-cli/index.js',
    '/usr/local/lib/node_modules/postcss-cli/bin/postcss'
  ]
}
dirkolbrich commented 5 years ago

Seems to be a Node/Npm setup issue for access to global node_modules under Netfly and GitLab, as it can not find node-releases/data/processed/envs.json.

chris-79 commented 5 years ago

Indeed. And no amount of tweaking has helped. Granted, I'm not a node developer, so maybe there is a solution, but I have no idea how to fix it

dirkolbrich commented 5 years ago

Me neither, sorry.

creative-ae commented 3 years ago

any fix ???