简体   繁体   English

CSS npm 运行构建 [vue.js] 中的缩小错误

[英]CSS minification error in npm run build [vue.js]

Im receiving this error everytime I try to run 'npm run build' and I dont have any css file.每次我尝试运行“npm run build”并且我没有任何 css 文件时,我都会收到此错误。

ERROR Error: CSS minification error: Unexpected ":" found.. File: css/app.86f0ef2e.css错误错误:CSS 缩小错误:发现意外的“:”。文件:css/app.86f0ef2e.css

Error: CSS minification error: Unexpected ":" found.. File: css/app.86f0ef2e.css at C:\Users\LesterKingsley\OneDrive\Desktop\vuewuna\dos\node_modules@intervolga\optimize-cssnano-plugin\index.js:106:21 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Promise.all (index 0)错误:CSS 缩小错误:发现意外的“:”。文件:css/app.86f0ef2e.css at C:\Users\LesterKingsley\OneDrive\Desktop\vuewuna\dos\node_modules@intervolga\optimize-cssnano-plugin\index. js:106:21 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Promise.all (index 0)

I'm new to vue, I don't have a clue to solve this problem.我是 vue 新手,我不知道如何解决这个问题。

I faced this same error last week, and this is my solution to it.上周我遇到了同样的错误,这是我的解决方案。 I'm not sure if it's going to work for you though.我不确定它是否对你有用。 What I did basically was these;我所做的基本上是这些;

  • I found and removed the file that course the error (in my case public/css/argon.css) then I cut out all the codes inside of that file and saved.我找到并删除了导致错误的文件(在我的例子中是 public/css/argon.css),然后我删除了该文件中的所有代码并保存。
  • Then I ran npm run build and it built successfully.然后我运行 npm run build 并成功构建。
  • After the build process had completed, I then pasted the codes inside of the file (in my case dist/css/argon.css) and the vuejs created css.构建过程完成后,我将代码粘贴到文件中(在我的例子中是 dist/css/argon.css),然后 vuejs 创建了 css。 That solved the problem.那解决了问题。 Pls give a thumbs up if that works for you.如果这对你有用,请竖起大拇指。

The problem is sometimes in the ::v-deep label:问题有时出在::v-deep标签中:

// WRONG:
::v-deep(.some-class) { ... }

// READY:
::v-deep .some-class { ... }

Please comment all your internal css.评论您所有的内部 css。 This work for me successfully.这对我来说很成功。

I too did not have any external css file.我也没有任何外部 css 文件。 But the issues were in my internal files.但问题出在我的内部文件中。

This is the line that cause the error text-align: calc();这是导致错误text-align: calc();的行

I got this error.我收到了这个错误。 For me the problem was this:对我来说问题是这样的:

input['text'], 
input['email'] {
    user-select: initial;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM