ionic-framework - 执行 ionic serve 时出错

标签 ionic-framework

当我执行 ionic serve 时,它​​显示以下错误:

Refused to load the image 'http://localhost:8100/favicon.ico' because it violates the following Content Security Policy directive: "default-src 'none'". Note that 'img-src' was not explicitly set, so 'default-src' is used as a fallback.

Failed to load resource: the server responded with a status of 404 (Not Found)



我该如何解决这个问题?

最佳答案

我有同样的错误信息。

查看执行时打印的日志

ionic serve



向我展示了一堆错误,都与此类似

[ng] ERROR in ./src/global.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/global.scss)

[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):

[ng] Error: Cannot find module 'node-sass'

[ng] Require stack:

这使我重新启动并运行应用程序

npm install node-sass --save



编译过程有时会不时地吐出相当困惑的错误消息,但稍微挖掘一下就可以开始猜测从哪里开始戳

关于ionic-framework - 执行 ionic serve 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56248740/

相关文章:

android - Ionic5 电容器修复 AndroidManifest.xml 缺少 Activity 名称

html - 如何在 <ion-img> 上设置高度

javascript - AngularJS 确定 ng-repeat 中的索引

typescript 错误: would overwrite input file

javascript - 从 Controller 调用指令

angular - 背景地理定位 ionic 3 不更新

angularjs - Ngmessages Uncaught TypeError l.module(...).info 不是函数

ionic-framework - 如何在 Ionic 2 应用程序中提取和重用导航栏模板和逻辑?

angularjs - 如何将默认时间设置为 ionic 时间类型的html输入字段

cordova - 使 ionic 以横向模式打开应用程序