Ionic 2 Starter

Hello,

I tried to install ionic 2 alpha tutorial project however the css files are missing in the console it gives me this error message
http://localhost:8100/build/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)

Also I see the same page when i deploy to android

I followed the guidlines and the commands that i use is the followings:
npm install -g ionic@alpha
ionic start myproject tutorial --v2
cd myproject
ionic serve

for android i use
ionic platform add android
ionic run android 

While deploying to android device i do not get any errors. It runs on the device what with pure html, no css, no ionic. I use windows 10 operating system to build.

I really want to try ionic 2 so waiting for your help.

You lose a step, the Sass compiles to CSS files。

cd youproject
npm install
gulp build
gulp serve or ionic serve

recommended the use of ionic lab tools

I’m seeing the same issue on Mac OSX using the tutorial project. I have used CLI “ionic serve” as well as Ionic Lab:

@Wall-E: Trying “npm install” then “gulp build” results in “[13:42:34] No gulpfile found”.

What am I missing?

We updated the CLI to use a webpack only build (no more gulp for now), but the tutorial didn’t get updated it seems like! Fixing it now, hang tight :slight_smile:

Ok if you update to the latest alpha version of the CLI: npm install -g ionic@alpha and start a new tutorial ionic start myApp tutorial --v2 it should be working now.

Let me know if you have any issues!

1 Like

Official updates and fixes,now it’s ok !

Hey Tim, just going to jump on this as I was experiencing the same issue yesterday when I started playing around with the Alpha release.

When I run ionic start myApp tutorial --v2 I receive the following error:

Unable to run exec commandError: Command failed: /bin/sh -c npm install --production
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/Cellar/node/5.0.0/bin/node" "/usr/local/bin/npm" "install" "--production"
npm ERR! node v5.0.0
npm ERR! npm  v3.3.9

npm ERR! Invalid Version: 0.0.1alpha1
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/kruegerb/Documents/Personal/gym-king/myApp/npm-debug.log
 (CLI v2.0.0-alpha.22)

Your system information:

Cordova CLI: 5.4.0
Gulp version:  CLI version 3.8.11
Gulp local:   Local version 3.9.0
Ionic CLI Version: 2.0.0-alpha.22
Ionic App Lib Version: 2.0.0-alpha.21
ios-deploy version: Not installed
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v5.0.0
Xcode version: Xcode 7.1.1 Build version 7B1005 

However it still creates the directory. I then try to ionic serve from inside the directory and it opens a webpage, however it 404’s on everything:

http://localhost:8100/build/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8100/build/js/app.bundle.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8100/build/css/app.css Failed to load resource: the server responded with a status of 404 (Not Found)

However… If I do sudo ionic start myApp tutorial --v2 it does not throw that initial error.
For simplicity I sudo chown -R (user) *' and 'sudo chmod -R 777 *.

When I try to run ionic serve after that I receive:

/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/css-loader!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/resolve-url-loader!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/sass-loader?sourceMap!./www/app/hello-ionic/hello-ionic.scss

Module build failed: CssSyntaxError: /css-loader!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/resolve-url-loader/index.js!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/sass-loader/index.js?sourceMap!/Users/(user)/Documents/Personal/gym-king/myApp2/www/app/hello-ionic/hello-ionic.scss:2:7: Unknown word

    at Input.error (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/input.js:61:21)

    at Parser.unknownWord (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:479:26)

    at Parser.word (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:174:14)

    at Parser.loop (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:60:26)

    at parse (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parse.js:25:12)

    at new LazyResult (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/lazy-result.js:57:24)

    at Processor.process (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/processor.js:36:16)

    at processCss (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/css-loader/lib/processCss.js:171:11)

    at Object.module.exports (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/css-loader/lib/loader.js:24:2)

 @ ./www/app/hello-ionic/hello-ionic.scss 4:14-581,/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/css-loader!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/resolve-url-loader!/Users/(user)/.npm-packages/lib/~/ionic/~/ionic-app-lib/~/sass-loader?sourceMap!./www/app/app.scss

Module build failed: CssSyntaxError: /css-loader!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/autoprefixer/lib/autoprefixer.js?browsers=last 2 version!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/resolve-url-loader/index.js!/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/sass-loader/index.js?sourceMap!/Users/(user)/Documents/Personal/gym-king/myApp2/www/app/app.scss:2:7: Unknown word

    at Input.error (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/input.js:61:21)

    at Parser.unknownWord (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:479:26)

    at Parser.word (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:174:14)

    at Parser.loop (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parser.js:60:26)

    at parse (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/parse.js:25:12)

    at new LazyResult (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/lazy-result.js:57:24)

    at Processor.process (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/postcss/lib/processor.js:36:16)

    at processCss (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/css-loader/lib/processCss.js:171:11)

    at Object.module.exports (/Users/(user)/.npm-packages/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/css-loader/lib/loader.js:24:2)

 @ ./www/app/app.scss 4:14-561 (CLI v2.0.0-alpha.22)

Your system information:

 

Cordova CLI: 5.4.0

Gulp version:  CLI version 3.8.11

Gulp local:   Local version 3.9.0

Ionic Version: 2.0.0-alpha.31

Ionic CLI Version: 2.0.0-alpha.22

Ionic App Lib Version: 2.0.0-alpha.21

ios-deploy version: Not installed

ios-sim version: 3.1.1

OS: Mac OS X Yosemite

Node Version: v5.0.0

Xcode version: Xcode 7.1.1 Build version 7B1005

Being new to Ionic, I’m not sure if these errors are caused by my lack of knowledge or something wrong in the alpha release.

@BCKrueger not sure about the first issue, it sounds like you could have something off with your node or npm permissions.

The second issue should go away once you update to the latest version of ionic@alpha.

Thanks for helpin me trouble shoot this @tim.

So the first problem was because npm was directed at a private repository (which had references to ionic 1 stuff but not ionic 2 stuff). Once I changed to the npmjs repo it went away.

The second error was indeed caused by having alpha.22 version… After manually uninstalling Node and manually deleting the global package I was able to get alpha.23 and everything worked! :smiley:

1 Like

I tried again today and after updating ionic alpha and creating a new tutorial v2 project, i get another exception like this when i try to run on android:

c:\ionicprojects\myproject2>ionic run android
Running command: "C:\Program Files\nodejs\node.exe" c:\ionicprojects\myproject2\
hooks\after_prepare\010_add_platform_class.js c:\ionicprojects\myproject2
add to body class: platform-android
Running command: cmd "/s /c "c:\ionicprojects\myproject2\platforms\android\cordo
va\run.bat""
ANDROID_HOME=C:\android-sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_40
WARNING : No target specified, deploying to device 'ceb1f64d'.
Running: c:\ionicprojects\myproject2\platforms\android\gradlew cdvBuildDebug -b
c:\ionicprojects\myproject2\platforms\android\build.gradle -PcdvBuildArch=arm -D
org.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJavaC:\ionicprojects\myproject2\platforms\android\Cordov
aLib\src\org\apache\cordova\CordovaResourceApi.java:31: error: package org.apach
e.http.util does not exist
import org.apache.http.util.EncodingUtils;
                   ^
C:\ionicprojects\myproject2\platforms\android\CordovaLib\src\org\apache\cordova\
CordovaResourceApi.java:430: error: cannot find symbol
byte[] data = base64 ? Base64.decode(dataPartAsString, Base64.DEFAULT) :
 EncodingUtils.getBytes(dataPartAsString, "UTF-8");

 ^
  symbol:   variable EncodingUtils
  location: class CordovaResourceApi
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
2 errors
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug
option to get more log output.

BUILD FAILED

Total time: 3.18 secs

c:\ionicprojects\myproject2\platforms\android\cordova\node_modules\q\q.js:126
            throw e;
                  ^
Error code 1 for command: cmd with args: /s /c "c:\ionicprojects\myproject2\plat
forms\android\gradlew cdvBuildDebug -b c:\ionicprojects\myproject2\platforms\and
roid\build.gradle -PcdvBuildArch=arm -Dorg.gradle.daemon=true"
ERROR running one or more of the platforms: Error: cmd: Command failed with exit
 code 1
You may not have the required environment or OS to run this project

c:\ionicprojects\myproject2>