简体   繁体   English

.scss文件无法自动编译.css

[英].scss files not compiling .css automatically

I am using Ionic and I have a Gulpfile.js that worked perfectly before. 我正在使用Ionic并且我有一个Gulpfile.js之前可以很好地工作。 I updated npm, Angular, Ionic and cordova, which has broken my working environment. 我更新了npm,Angular,Ionic和Cordova,这破坏了我的工作环境。

Right now , I need to manually start ionic serve (or gulp watch) so that it recognizes that I make changes in my .scss file and then compiles it to .css 现在 ,我需要手动启动ionic serve (或gulp监视),以便它识别出我在.scss文件中进行了更改,然后将其编译为.css

Before these updates, I could change my .scss file and it would automatically recognize the changes and compile it to .css instead of me triggering ionic serve or gulp watch manually beforehand. 在进行这些更新之前 ,我可以更改.scss文件,它将自动识别所做的更改并将其编译为.css,而无需事先手动触发ionic serve或大gulp watch

This is what ionic info gives me: 这是ionic info给我的:

WARN] Error with ./www/lib/ionic/version.json file: FILE_NOT_FOUND, trying ./bower.json. [警告] ./www/lib/ionic/version.json文件错误:FILE_NOT_FOUND,尝试使用./bower.json。

cli packages: (/usr/local/lib/node_modules) cli软件包:(/ usr / local / lib / node_modules)

 @ionic/cli-utils : 1.16.0 ionic (Ionic CLI) : 3.16.0 

global packages: 全局软件包:

 cordova (Cordova CLI) : 7.0.1 Gulp CLI : CLI version 3.9.1 Local version 3.9.1 

local packages: 本地套餐:

 Cordova Platforms : android 6.3.0 ios 4.4.0 Ionic Framework : ionic1 master 

System: 系统:

 ios-deploy : 1.9.0 ios-sim : 5.0.8 Node : v6.8.1 npm : 4.6.1 OS : macOS High Sierra Xcode : Xcode 9.1 Build version 9B55 

Environment Variables: 环境变量:

 ANDROID_HOME : not set 

Misc: 其他:

 backend : pro 

I am using xCode with cordova prepare ios to deploy it on the iPhone, but as you can understand, because the .css is not compiled automatically, the app does not recognize the css changes as it can not see them if I don't do it manually. 我正在将xCodecordova prepare ios一起使用,以便将其部署到iPhone上,但是您可以理解,由于.css不会自动编译,因此该应用程序无法识别css更改,因为如果我不这样做,它将看不到它们手动。

How can I fix this? 我怎样才能解决这个问题?

Alright, this seems like it's an Ionic CLI problem. 好吧,这似乎是一个Ionic CLI问题。 After updating to Ionic CLI 3, the gulp watch tasks are not being triggered, which gives this annoying problem. 更新到Ionic CLI 3后,没有触发gulp watch任务,这带来了令人讨厌的问题。

You can see that one of the developers is stating he will fix this. 您可以看到其中一位开发人员表示他将解决此问题。

https://github.com/ionic-team/ionic-cli/issues/2859#issuecomment-342338626 https://github.com/ionic-team/ionic-cli/issues/2859#issuecomment-342338626

Edit: it's fixed now. 编辑:现在已修复。 You can fix it by installing the alpha CLI via npm i -g ionic@canary. 您可以通过npm i -g ionic@canary.安装alpha CLI来修复它npm i -g ionic@canary.

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

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