执行 ionic serve 时出错 [英] I have an error when executing ionic serve
问题描述
当我执行 ionic serve 时,显示以下错误:
When I execute ionic serve, it shows the following errors:
拒绝加载图像 'http://localhost:8100/favicon.ico' 因为它违反了以下内容安全策略指令:默认-src '无'".请注意,'img-src' 没有明确设置,所以'default-src' 用作后备.
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.
加载资源失败:服务器响应404 状态(未找到)
Failed to load resource: the server responded with a status of 404 (Not Found)
我该如何解决这个问题?
How can I solve this?
推荐答案
我有同样的错误信息.
查看执行时打印的日志
离子服务
向我展示了一堆错误,都与此类似
showed me a bunch of errors, all similar to this
[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
npm install node-sass --save
编译过程有时会不时地吐出相当混乱的错误消息,但稍微挖掘一下就可以开始猜测从哪里开始戳
The compilation process is sometimes spitting out rather confusing error messages from time to time, but with a little digging one can start guessing where to start poking
这篇关于执行 ionic serve 时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!