mhanberg / mhanberg/jekyll-postcss

Netlify issue: missing node_modules packages. (resolved, but FYI)

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
70
Forks
12
PR merge metrics
No merged PRs in 30d

Description

In your README you mention that you must install postcss with npm or yarn. I'd done this with yarn add <package-name> -D, which places things in the devDependencies hash key in package.json. This is fine. Typically running bundle exec jekyll build locally will result in everything working just fine. Great!

Here's the hiccup: In many jekyll + postcss blog posts (eg: here) there are instructions that instruct people to set the following ENV variables:

When building for production, always set JEKYLL_ENV=production and NODE_ENV=production on the command line. When these variables are set to production, unused Tailwind styles are purged and the output is processed with cssnano.

This where the problem comes in. When deploying and building on Netlify NODE_ENV=production + yarn add ______ -D seems to result in an empty ./node_modules directory.

When I moved everything from devDependencies to dependencies in packages.json then everything started working.

I don't know if this is a Netlify thing or not but, in the off-chance anyone shows up here with missing node_modules packages, this might be the answer.

TLDR: Do not install your node dependencies via yarn add .... -D or npm install <package-name> --save-dev

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report discusses README installation guidance, package.json dependency sections, and production builds using JEKYLL_ENV and NODE_ENV. Start by checking the README and package.json, then compare the local bundle exec jekyll build with the Netlify production setup. The issue is marked resolved and specifies no requested code or documentation change.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, ruby, tailwindcss
Domain
build-system, devops
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.