css - 尝试构建 css 时发生 Tailwindcss 错误

标签 css frameworks tailwind-css

尝试学习顺风,但当我尝试构建 CSS 时,我不断收到错误。我关注了多个视频,每次都遇到此错误。

这是我不断收到的错误。 $ npm 运行构建

> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="f2829e9386949d9f80b2c3dcc2dcc2" rel="noreferrer noopener nofollow">[email protected]</a> 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! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="6b1b070a1f0d0406192b5a455b455b" rel="noreferrer noopener nofollow">[email protected]</a> build: `tailwind build assest/styles.css -o public/styles.css`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4a4b8b5a0b2bbb9a694e5fae4fae4" rel="noreferrer noopener nofollow">[email protected]</a> 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

这是我的 json 文件

{
  "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

任何帮助将不胜感激。预先感谢您。

最佳答案

npm i tailwindcss@latest autoprefixer@latest

解决了我的问题

关于css - 尝试构建 css 时发生 Tailwindcss 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64951525/

相关文章:

html - 如何确保 <td> 的高度恰好是 200px?

javascript - 确定元素的位置并触发滚动

ios - 在 swift 框架中使用 objective-c

angularjs - Ionic Framework 可以在 Chrome、Mozilla、IE9+ 等桌面网​​络浏览器中运行吗?

frameworks - 使用哪个 .net Web 应用程序框架?

html - Tailwind - 绝对位置与相对位置下拉列表

javascript - 移动 chrome 和模式的奇怪行为

css - `animation-fill-mode: none;` 不工作

reactjs - 顺风 CSS :before pseudo class

css - 表格 DIV 和 CSS