【问题标题】:Error message when trying to minify tailwindcss尝试缩小 tailwindcss 时出现错误消息
【发布时间】:2021-04-14 01:27:03
【问题描述】:

为了缩小我的 tailwindCSS,我尝试在我的 package.json 中创建一个脚本:

"tw:prod":"NODE_ENV=production npx tailwindcss-cli@latest build ./src/css/tailwind.css -o ./public/css/tailwind.css",

但它给出了这个错误:

> '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! ntwport@1.0.0 tw:prod: `NODE_ENV=production npx
> tailwindcss-cli@latest build ./src/css/tailwind.css -o
> ./public/css/tailwind.css` npm ERR! Exit status 1 npm ERR! npm ERR!
> Failed at the ntwport@1.0.0 tw:prod 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\gabri\AppData\Roaming\npm-cache\_logs\2021-01-08T10_21_19_799Z-debug.log

该脚本是在tailwincss的文档中找到的,为什么会出现这个错误?

【问题讨论】:

标签: css json npm tailwind-css


【解决方案1】:

如果你运行的是windows系统,你需要安装win-node-env dev依赖。然后你运行 tw:prod:

npm install win-node-env

【讨论】:

    猜你喜欢
    • 2021-03-05
    • 2018-06-28
    • 1970-01-01
    • 1970-01-01
    • 2018-03-22
    • 2013-02-14
    • 2018-10-27
    • 2020-11-16
    • 2017-10-02
    相关资源
    最近更新 更多