2

trying to learn tailwind but when I try to build the CSS I keep getting errors. I've followed multiple videos and every time I run into this error.

this is the error that I keep getting. $ npm run build

> [email protected] build C:\Users\ghost\Dropbox\portfolio project\Discovery TV Platform
> tailwind build assest/styles.css -o public/styles.css

internal/modules/cjs/loader.js:463
  throw e;
  ^

Error: Package exports for 'C:\Users\ghost\node_modules\colorette' do not define a valid '.' target
    at resolveExportsTarget (internal/modules/cjs/loader.js:460:13)
    at resolveExports (internal/modules/cjs/loader.js:393:16)
    at Function.Module._findPath (internal/modules/cjs/loader.js:492:20)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:787:27)
    at Function.Module._load (internal/modules/cjs/loader.js:693:27)
    at Module.require (internal/modules/cjs/loader.js:864:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (C:\Users\ghost\node_modules\autoprefixer\lib\autoprefixer.js:3:17)      
    at Module._compile (internal/modules/cjs/loader.js:971:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1011:10) {
  code: 'MODULE_NOT_FOUND'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `tailwind build assest/styles.css -o public/styles.css`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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\ghost\AppData\Roaming\npm-cache\_logs\2020-11-22T07_01_12_878Z-debug.log

here is my json file

{
  "name": "platfomr",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "tailwindcss build assest/styles.css -o public/styles.css"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "tailwindcss": "^2.0.1"
  }
}
enter code here

any help would be greatly appreciated. Thank you in advance.

3 Answers 3

6
npm i tailwindcss@latest autoprefixer@latest

solved the problem for me

Sign up to request clarification or add additional context in comments.

Comments

0

after further reseach i foud the answer on a Github form - https://github.com/tailwindlabs/tailwindcss/discussions/2054

basically, if you're running a node v13 releases you need to update to a higher version.

Tailwindcss doesn't commit the package.lock file, and uses semver for autoprefixer dependency, which added colorette in a later minor version, causing it to suddenly break for users of these faulty node releases.

Comments

0

It looks like you might be missing a dependency required by Tailwind. You could try running npm install -D postcss in the directory where your package.json. Worked for me!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.