ionic-team / ionic-cli Goto Github PK
View Code? Open in Web Editor NEWThe Ionic command-line interface
License: MIT License
The Ionic command-line interface
License: MIT License
The form-data module used for the upload task will not let the user catch or handle a 404 error (for example). This makes it impossible to return any meaningful error message back to the user.
Language here is a bit confusing ionic.fail('Unable to start server:', err);
I suggest reference which server fails ionic.fail('Unable to start livereload server:', err);
https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/serve.js#L70-L79
See issue: http://forum.ionicframework.com/t/why-ionic-serve-fails/4466/2
If there is a net work error when creating a new project, the message printed out is pretty obscure.
/usr/local/lib/node_modules/ionic/node_modules/progress/lib/node-progress.js:130
complete = Array(Math.round(width * ratio)).join(this.chars.complete);
^
RangeError: Invalid array length
at ProgressBar.render (/usr/local/lib/node_modules/ionic/node_modules/progress/lib/node-progress.js:130:14)
at ProgressBar.tick (/usr/local/lib/node_modules/ionic/node_modules/progress/lib/node-progress.js:86:8)
at IncomingMessage. (/usr/local/lib/node_modules/ionic/lib/ionic.js:546:13)
at IncomingMessage.EventEmitter.emit (events.js:117:20)
at IncomingMessage. (stream_readable.js:745:14)
at IncomingMessage.EventEmitter.emit (events.js:92:17)
at emitReadable (_stream_readable.js:407:10)
at emitReadable (_stream_readable.js:403:5)
at readableAddChunk (_stream_readable.js:165:9)
at IncomingMessage.Readable.push (_stream_readable.js:127:10)
Exiting.
Can this be handled with a cleaner, less obscure warning?
Ubuntu 13.04.
npm 1.3.14
node 0.10.22.
Running ionic start whatever
returns:
Running start task...
Creating Ionic app in folder /home/sander/whatever
Downloading starter template from https://github.com/driftyco/ionic-angular-cordova-seed/archive/master.zip
events.js:72
throw er; // Unhandled 'error' event
^
Error: EACCES, open '/tmpionic-angular-cordova-seed1386308061693.zip'
Running the command via sudo works, but then have to run everything interacting with it with root.
Am not behind a proxy and I was able to do this earlier. Now I upgrade to windows 8.1 and the command below wont work.
ionic start myApp blank
I have updated cordova, re-installed windows and started again. But no change. If there is a workaround someone let me know. Here is my cmd output.
C:\Users\Martin>ionic start myapp blank
Running start task...
Creating Ionic app in folder C:\Users\Martin\myapp based on blank project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
DOWNLOADING: https://github.com/driftyco/ionic-starter-blank/archive/master.zip
Initializing cordova project.
Fetching plugin "org.apache.cordova.device" via plugin registry
Fetching plugin "org.apache.cordova.console" via plugin registry
ERROR: Unable to add plugins. Perhaps your version of Cordova is too old. Try up
dating (npm install -g cordova), removing this project folder, and trying again.
Exiting.
C:\Users\Martin>
well an issue that perhaps lands between feature request / bug - just close if I'm on the wrong track here:
with cordova we can do:
$ cd <project app>
$ cordova platform update android
with ionic we currently can do:
$ ionic platform add android
Running platform task...
Adding platform android
...
should we expect to be able to do ?
$ ionic platform update android
Running platform task...
Adding platform update
Platform "update" not recognized as a core cordova platform. See "platform list".
...
Might be nice to be able to start an Ionic app without Cordova, if you are building a mobile website or something like that.
This is more a feature request than a bug/issue:
with
npm update -g ionic
one can update the command line.
In case that ionic is under heavy development, it should offer options to update an existing project with new releases of ionic. Today one needs to manually copy files and folders for ionic specific stuff. I think this could be automated and enhance the overall workflow for developing apps with ionic.
I'm not sure what version I was using earlier, but after update ionic, "serve" opens blank page on old projects.
I'm yet to find the cause.
I see a lot of people talking about this on the forum. Mike said to make an issue.
It would be great if we could do:
ionic platform update ios
ionic platform update android
which would mirror the cordova platform command
When i try to start a new project i get the following errror:
$ ionic start HybridDemo sideMenu
Running start task...
Creating Ionic app in folder /Users/xxx/Desktop/HybridDemo based on sideMenu project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
DOWNLOADING: https://github.com/driftyco/ionic-starter-sideMenu/archive/master.zip
Initializing cordova project.
Fetching plugin "org.apache.cordova.device" via plugin registry
Error: failed to fetch the plugin archive
at /usr/local/lib/node_modules/cordova/node_modules/plugman/src/registry/registry.js:60:26
at Request.cb [as _callback] (/usr/local/lib/node_modules/cordova/node_modules/plugman/src/registry/registry.js:251:9)
at self.callback (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:117:20)
at ClientRequest.self.clientErrorHandler (/usr/local/lib/node_modules/cordova/node_modules/plugman/node_modules/request/index.js:257:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketErrorListener (http.js:1547:9)
at Socket.EventEmitter.emit (events.js:95:17)
at net.js:440:14
at process._tickCallback (node.js:415:13)
ERROR: Unable to add plugins. Perhaps your version of Cordova is too old. Try updating (npm install -g cordova), removing this project folder, and trying again.
Exiting.
reproduced on OSX and windows 8. obiuvsly cordova and ionic are up-to date
Our prompts could benefit from readline support in node to enable things like history and shell expansion:
Hi,
I am trying to install Ionic and it is hanging on "Fetching repo: https://github.com/driftyco/ionic-app-base/archive/master.zip". It appears to have unzipped the directory but it never seems to progress an further? If I cancel the install and then cd into the directory and to to run npm install it errors with ENOPACKAGEJSON so I'm not sure what is going on:
I have NVM installed and I am using node v0.11.11. Any help would be appreciated.
Thanks
Hi,
$ node -v
v0.10.22
$ npm -v
1.3.14
I'm on Mac just tried to run demo app according to getting-started, i got an error:
$ ionic platform ios
Running platform task...
Adding platform ios
/bin/sh: cordova: command not found
Unable to add platform ios. Please see console for more info.
So cordova binary here
/usr/local/lib/node_modules/ionic/node_modules/cordova/bin/cordova
/usr/local/lib/node_modules/ionic/node_modules/.bin/cordova
ionic is global:
$ which ionic
/usr/local/bin/ionic
But cordova doesn't:
$ which cordova
cordova not found
Should I install cordova globally as a separate installation?
hi i just started using ionic via windows 7 x64
when i create new project, with CLI
ionic start myApp
then ionic cannot start
when I run it the CLI returns always this error:
D:\source>ionic start myApp
fs.js:642
return binding.mkdir(pathModule._makeLong(path),
^
Error: ENOENT, no such file or directory 'D:\Users\Rasyid\.ionic'
at Object.fs.mkdirSync (fs.js:642:18)
at Object.module.exports.save (C:\Users\Rasyid\AppData\Roaming\npm\node_modules\ionic\lib\ionic\config.js:36:10)
at Object.module.exports.create (C:\Users\Rasyid\AppData\Roaming\npm\node_modules\ionic\lib\ionic\config.js:44:10)
at Object.module.exports.getConfig (C:\Users\Rasyid\AppData\Roaming\npm\node_modules\ionic\lib\ionic\config.js:15:12)
at Object.<anonymous> (C:\Users\Rasyid\AppData\Roaming\npm\node_modules\ionic\lib\ionic\stats.js:518:31)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
thx before
I think we should refactor the cli to use a better more generic command line handling tool. As it stands the code is pretty crappy.
OSX
v1.1.5-beta2
ionic start myApp tabs -a tabby
ionic platform add ios
ionic platform add android
ionic login
, successionic package
with no arguments, get this: http://d.pr/i/JuSJForum : http://forum.ionicframework.com/t/ionic-start-gitignore/3063
OP suggests NOT adding node_modules
to ".gitignore".
Links to a very valid point about the need to include node_modules
in EACH apps source tree.
http://www.futurealoof.com/posts/nodemodules-in-git.html
How should Ionic deal with this?
If I type ionic foobar
the start screen (ionic
) will be printed.
That's nice but it would be helpful to get some message like this is not a valid command - please try one of this
when running the cli command ionic
it is confusion that it shows 1.1.6 after the ascii-art ionic. Maybe we can indicate both the ionic AND ionic-cli version.
Since 1.1.5, ionic platform <PLATFORM>
does not add platform.
Instead it logs already installed platforms and available ones:
Installed platforms:
Available platforms: amazon-fireos, android, blackberry10, firefoxos, windows8, wp8
Downgrading to 1.1.4: works normally again.
ionic start myApp
Running start task...
Creating Ionic app in folder /home/tim/Desktop/myApp
Downloading starter template from https://github.com/driftyco/ionic-angular-cordova-seed/archive/master.zip
Project created!
Initializing cordova project.
Error: ENOENT, no such file or directory '/home/tim/Desktop/platforms'
Also: http://forum.ionicframework.com/t/the-platforms-does-not-exist/
The current version of Ionic in npm shows 0.9.16 (2014-02-08T16:44:31.809Z) but on github / the Ionic website I can find version 0.9.23.
If there is a difference, what is it?
Thanks!
i can't install v1.0.17 on windows 7 .
i had a beta version earlier and it worked fine but today when i tried to update
npm update -g ionic
https://drive.google.com/file/d/0B9jT3gxRlacROV8yQnd1ajFlSVk/edit?usp=sharing
it broke everything now i am without ionic
pls help
Hi,
seems like there have been some changes how projects are initialized.
Why this https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/start.js#L168?
I really don't care what name the boilerplate had, I used.
Why force me to have such ugly folder names like ionic-app-base-master
- just call it "app" or something.
But where does the "ionic.project" file comes from? What is it for?
Why not put it beside the rest of the app?
Seems ugly this way and forces me to make another cd ugly-folder-name
to be able to do some gulp
, ionic
etc stuff.
This also crashs your documentation as it needs the info to have another cd
.
Seems like a mistake and doesn't seems like fun.
Found incorrect comment in platform.js and on serve.js
https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/platform.js#L21
no - not find the app name but slice away "platform"
https://github.com/driftyco/ionic-cli/blob/master/lib/ionic/serve.js#L22
no - not find the app name but get the port number
Since the Ionic CLI has been moving toward a full Cordova CLI coverage, how about Ionic include the plugin commands? And even extend on the plugin commands, with a pluing update ...
feature?
Sure, cordova is simple to use as so:
$ cordova plugin add org.apache.cordova.camera
But for updating a plugin it requires two lines of code:
$ cordova plugin rm org.apache.cordova.camera
$ cordova plugin add org.apache.cordova.camera
The Ionic CLI could extend on this and have two options:
eg:
$ ionic plugin update org.apache.cordova.camera
$ ionic plugin update -all
An update would literally just rm
and re- add
the plugin, which is syntactically simple, but gives ionic developers a simpler way of dealing with cordova.
If you like this feature I would very much like to help and could create a PR to start off from.
The guide teaches to create a release version via
cordova build --release android
http://ionicframework.com/docs/guide/publishing.html
There is
ionic build android
- so I don't have to use cordova in that place (directly), what about and ionic build --release android
or ionic release android
command?
Kicking off via cli using :
ionic start myApp tabs
cd myApp
ionic platform add ios
ionic build ios
ionic emulate ios
produces an app that runs properly in the simulator.
However, in Chrome, it produces errors and displays no header.
Additionally, there is an errant swap file in the www directory : "-rw-r--r-- 1 jn staff 12288 Apr 10 09:06 .index.html.swp"
I'm behind a proxy server, so have to set PROXY
env when launching ionic
cli. The command ionic start
download a file from GitHub that, in my workplace, has the HTTPS with invalid certificate. In this environment i get the following error:
C:\Users\ggherardi\Temp\ionic>SET PROXY=http://ggherardi:[email protected]:8090
C:\Users\ggherardi\Temp\ionic>node_modules\.bin\ionic start myApp tabs
Running start task...
Creating Ionic app in folder C:\Users\ggherardi\Temp\ionic\myApp based on tabs project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
C:\Users\ggherardi\Temp\ionic\node_modules\ionic\lib\ionic.js:257
if(res.statusCode !== 200) {
^
TypeError: Cannot read property 'statusCode' of undefined
at Request._callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\lib\ionic.js:257:13)
at self.callback (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:129:22)
at Request.EventEmitter.emit (events.js:95:17)
at ClientRequest.self.clientErrorHandler (C:\Users\ggherardi\Temp\ionic\node_modules\ionic\node_modules\request\request.js:239:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at CleartextStream.socketErrorListener (http.js:1547:9)
at CleartextStream.EventEmitter.emit (events.js:95:17)
at SecurePair.<anonymous> (tls.js:1389:19)
at SecurePair.EventEmitter.emit (events.js:92:17)
at SecurePair.maybeInitFinished (tls.js:982:10)
After a bit of research, seems that the error is related to the invalid HTTPS certificate, in fact the err
parameter in the request
callback has the following message:
https [Error: UNABLE_TO_VERIFY_LEAF_SIGNATURE]
Any idea on how can i make this working?
I just installed ionic globally via sudo npm install -g ionic
and am getting this error after creating a new project, testing in the iOS simulator and then running ionic serve
:
/usr/local/share/npm/lib/node_modules/ionic/lib/ionic/serve.js:30
ionic.latestVersion.promise.then(function(){
^
TypeError: Cannot read property 'promise' of undefined
at Object.IonicServeTask.run (/usr/local/share/npm/lib/node_modules/ionic/lib/ionic/serve.js:30:22)
at Object.Ionic.run (/usr/local/share/npm/lib/node_modules/ionic/lib/ionic.js:337:13)
at Object.<anonymous> (/usr/local/share/npm/lib/node_modules/ionic/bin/ionic:10:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
ionic --version
returns Installed Ionic CLI version: 1.1.3
When doing sudo npm install -g ionic I get:
npm WARN package.json [email protected] No repository field.
When I run ionic start myApp tabs/sidemenu
I only get the base project.
➜ blist ionic start blist sidemenu
Running start task...
Creating Ionic app in folder /Users/mhamel/Development/fun/blist/blist based on sidemenu project
DOWNLOADING: https://github.com/driftyco/ionic-app-base/archive/master.zip
➜ blist tree blist/ionic-app-base-master/www/
blist/ionic-app-base-master/www/
├── index.html
├── js
│ └── app.js
└── lib
└── ionic
├── css
│ ├── ionic.css
│ └── ionic.min.css
└── fonts
├── ionicons.eot
└── ionicons.svg
5 directories, 6 files
I also noticed that the ionic.bundle.js doesn't seem to be added either.
Essentially a way to zip up a project and send it off to be built by ionic studio.
ionic --version
moved from ionic-team/ionic-framework#933
I ran into this issue when testing on WP8. The command "ionic run wp8 --device" does not seem to forward the "--device" flag to Cordova.
After looking into ionic/run.js, I can't see any code there to forward the flags. Is this intentional?
If not, the following code fixes this issue.
IonicRunTask.prototype.run = function(ionic) {
if(argv._.length < 2) {
IonicRunTask.prototype._printUsage();
ionic.fail('No platforms specified, exiting.');
}
var flags = " ";
for (var i in argv) {
if (i !== "_" && i !== "$0") {
flags += " --" + i;
}
}
var platforms = argv._.slice(1);
if(platforms.length < 1) {
ionic.fail('No platforms specified, exiting.');
}
IonicStats.t('run', { 'platform': platforms.join(',') });
for(var i = 0; i < platforms.length; i++) {
var platform = platforms[i];
console.log('Running app on platform', platform);
if(exec("cordova run " + platform + flags).code !== 0) {
ionic.fail('Unable to run app on platform ' + platform + '. Please see console for more info.');
}
}
};
I think we should just include some documentation telling the users how to update the version of ionic. It's pretty simple.
F:\dev\ionic>ionic start myApp
Unable to save settings file: { [Error: ENOENT, no such file or directory 'F:\Users\IBM_ADMIN.ionic']
errno: 34,
code: 'ENOENT',
path: 'F:\Users\IBM_ADMIN.ionic',
syscall: 'mkdir' }
It'd be nice to know when people are running into issues. Maybe we can add a simple, anonymous error logging system.
We could wrap node-sass within the ionic cli to make development easier. Basically have commands like ionic sass
and ionic sass --watch
(along with hooking it up to ionic serve
), and not require developers to install ruby and sass (which ultimately makes development easier for those who haven't done previous projects with sass, and faster in getting the project configured and setup for development). Plus libsass will be much faster to compile.
From there we can modularize our scss even further and setup a process which builds their production CSS file with the bare minimum selectors and properties their app requires. Faster rendering, fewer bytes, no extra configuration on their end, and all with the benefits of sass.
For developers relying on scss for customizing their styles, running ionic lib update does not help. I was under the impression that it would update lib/ionic to the same source we're getting from a bower repository. Instead, it only updates the release folder only. Is there a way to incorporate scss folder and its gulpfile as part of the release folder?
It would be nice if you provided a command in ionic-cli to upgrade the ionic/dist files to the latest copies from master.
See if we can insert each platform's name into their respective build's index.html body class tag.
For example, an ios build would automatically get this in their body tag:
<body class="platform-ios">
And Android would automatically build with:
<body class="platform-android">
Not necessarily required, but may be a nice to have
We could have a release option that removes unnecessary files and strips everything down.
If gulp isn't installed, the start
command quietly ignores that but then the project doesnt' get set up at all
After the app has been prepared and the static files have been build, remove the sass files from the platform
directories.
npm http 304 https://registry.npmjs.org/colors
npm ERR! Error: No compatible version found: colors@'^0.6.2'
npm ERR! Valid install targets:
npm ERR! ["0.3.0","0.5.0","0.5.1","0.6.0","0.6.0-1","0.6.1","0.6.2"]
npm ERR! at installTargetsError (c:\Program Files\nodejs\node_modules\npm\lib\cache.js:685:10)
npm ERR! at c:\Program Files\nodejs\node_modules\npm\lib\cache.js:607:10
npm ERR! at saved (c:\Program Files\nodejs\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]
npm ERR! System Windows_NT 6.2.9200
Hi,
I just used the "start" task to create my first project but when I run it the CLI returns always this error:
C:\Users\...\AppData\Roaming\npm\node_modules\ionic\lib\ionic\stats.js:525
this.createdId();
^
TypeError: Object #<Object> has no method 'createdId'
at Object.exports.IonicStats.t (C:\Users\...\AppData\Roaming\npm\node_m
odules\ionic\lib\ionic\stats.js:525:12)
at Object.IonicStartTask._finish (C:\Users\...\AppData\Roaming\npm\node
_modules\ionic\lib\ionic\start.js:107:14)
at Extract.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules\i
onic\lib\ionic\start.js:87:13)
at Extract.EventEmitter.emit (events.js:117:20)
at DirWriter.<anonymous> (C:\Users\...\AppData\Roaming\npm\node_modules
\ionic\node_modules\unzip\lib\extract.js:42:10)
at DirWriter.EventEmitter.emit (events.js:117:20)
at end (C:\Users\...\AppData\Roaming\npm\node_modules\ionic\node_module
s\unzip\node_modules\fstream\lib\writer.js:323:12)
at C:\Users\...\AppData\Roaming\npm\node_modules\ionic\node_modules\unz
ip\node_modules\fstream\lib\writer.js:313:32
at endUtimes (C:\Users\...\AppData\Roaming\npm\node_modules\ionic\node_
modules\unzip\node_modules\fstream\lib\writer.js:216:58)
at setProps (C:\Users\...\AppData\Roaming\npm\node_modules\ionic\node_m
odules\unzip\node_modules\fstream\lib\writer.js:296:5)
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.