gregwolanski/eleventy-tailwindcss-alpinejs-starter

'ELEVENTY_PRODUCTION' is not recognized as an internal or external command

legiblyblabbing opened this issue · 8 comments

Hi Greg,

Thanks for putting this together.

I'm new to this, so apologies if the answer to this problem is obvious (I tried searching online but couldn't find anything).

I just downloaded the repo to my computer and am getting this error when running 'npm run build':

'ELEVENTY_PRODUCTION' is not recognized as an internal or external command,
operable program or batch file.
'NODE_ENV' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: ELEVENTY_PRODUCTION=true eleventy & NODE_ENV=production postcss styles/tailwind.css --o _site/style.css
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Any idea why?

Sorry if this is a silly question!

Thanks.

Looks like a problem on Windows. : / I haven’t used Windows in years. I’m afraid I can’t help. : (

Same issue :(

Same issue :(

Also on Windows?

No worries Greg.

If it helps anyone else on Windows, I was able to set up 11ty + tailwind just following the basic instructions on their home sites.

Then adding the following under "scripts" in package.json:

"build": "postcss css/tailwind.css -o _site/css/tailwind.css"

Running "build" in the terminal pushes tailwind.css (which you create when setting up Tailwind) into the _site folder (so your website build can use it)... I think through postcss, but I have no idea!

It's working though :)

Same issue :(

Also on Windows?

Yes Windows. I had to remove the ENV stuff to make it work.

Same issue :(

Also on Windows?

Yes Windows. I had to remove the ENV stuff to make it work.

run:

npm install --save-dev cross-env

change into:

package.json

"build": "cross-env ELEVENTY_PRODUCTION=true eleventy && cross-env NODE_ENV=production postcss styles/tailwind.css --o _site/style.css"

Same issue :(

Also on Windows?

This project should add cross-env into devDependencies as I mentioned above

Same issue :(

Also on Windows?

Yes Windows. I had to remove the ENV stuff to make it work.

run:

npm install --save-dev cross-env

change into:

package.json

"build": "cross-env ELEVENTY_PRODUCTION=true eleventy && cross-env NODE_ENV=production postcss styles/tailwind.css --o _site/style.css"

Thank you for your solution everything works fine now