如何在离子中创建main.css

时间:2017-07-22 16:41:24

标签: ionic-framework

我是离子新手。 我想创造一个新的测试离子应用程序。 我使用命令

创建了离子项目
npm install -g ionic cordova
ionic start gallery

并运行该应用。 但它无法构建main.css。

我想知道为什么编译工具不起作用。 那我怎么解决呢?

请帮帮我

这是控制台

GET http://localhost:8100/build/main.css 
core.es5.js:3046 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
util.js:60 Native: tried calling StatusBar.styleDefault, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ util.js:60
checkAvailability @ plugin.js:23
callCordovaPlugin @ plugin.js:107
(anonymous) @ plugin.js:226
value @ decorators.js:132
(anonymous) @ app.component.ts:18
t.invoke @ polyfills.js:3
onInvoke @ core.es5.js:4149
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
(anonymous) @ polyfills.js:3
t.invokeTask @ polyfills.js:3
onInvokeTask @ core.es5.js:4140
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
o @ polyfills.js:3
invoke @ polyfills.js:3
util.js:60 Native: tried calling SplashScreen.hide, but Cordova is not available. Make sure to include cordova.js or run in a device/simulator
cordovaWarn @ util.js:60
checkAvailability @ plugin.js:23
callCordovaPlugin @ plugin.js:107
(anonymous) @ plugin.js:226
value @ decorators.js:132
(anonymous) @ app.component.ts:19
t.invoke @ polyfills.js:3
onInvoke @ core.es5.js:4149
t.invoke @ polyfills.js:3
r.run @ polyfills.js:3
(anonymous) @ polyfills.js:3
t.invokeTask @ polyfills.js:3
onInvokeTask @ core.es5.js:4140
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
o @ polyfills.js:3
invoke @ polyfills.js:3
ion-dev.js?v=2.0.2:120 Dev server logger closed
11livereload.js?snipver=1:74 WebSocket connection to 'ws://localhost:35729/livereload' failed: Error during WebSocket handshake: Unexpected response code: 200
exports.Connector.Connector.connect @ livereload.js?snipver=1:74
(anonymous) @ livereload.js?snipver=1:55
(anonymous) @ livereload.js?snipver=1:1152
t.invokeTask @ polyfills.js:3
r.runTask @ polyfills.js:3
invoke @ polyfills.js:3
n @ polyfills.js:2
livereload.js?snipver=1:74 WebSocket connection to 'ws://localhost:35729/livereload' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

这是我运行应用程序时的屏幕截图。

http://prntscr.com/fyxmcd

2 个答案:

答案 0 :(得分:0)

有一个已修复的错误。运行

npm install @ionic/app-scripts@2.0.2 --save-dev

如果仍然出现此错误,请删除node module文件夹并运行

npm install

答案 1 :(得分:0)

今天是app-scripts的错误

Ionic Framework3 missing main.css

这个问题在一小时前解决了:

“升级回最新版本的app-scripts”

https://github.com/ionic-team/ionic/issues/12442

所以,一般来说 - 只是尝试重新安装。