How to clone an ember-cli project? - ember-cli

I am trying to test some Broccoli debugging. For that I do:
» git clone https://github.com/rwjblue/debugging-broccoli.git
» cd debugging-broccoli
» ember init # I am asked here about overwriting some files. I say no
» ember serve
And I am greeted with:
version: 0.1.11
You have to be inside an ember-cli project in order to use the serve command.
So, maybe it was not ember init, but ember install (whatever, ember init seems like the right command to initialize a cloned repository, but I digress ...). So I try ember install (with a fresh clone, just in case):
» git clone https://github.com/rwjblue/debugging-broccoli.git
» cd debugging-broccoli
» ember install
version: 0.1.11
You have to be inside an ember-cli project in order to use the install command.
So, how can I clone and serve an exisiting ember-cli repo?
Note
Strangely enough, in my application repo I have a different version of ember-cli:
» ember --version
version: 0.1.12
node: 0.10.25
npm: 2.1.8
I though ember-cli was installed globally ...

Using ember-cli -g is only for command line, you need it local. Use npm and bower install after cloning.

Related

ERROR:The serve command requires to be run in an Angular project, but a project definition could not be found

I am trying to clone the git repository for Tour of Heros with NgRX (blove/ngrx-tour-of-heros)
However, I can not seem to run the application.
I have updated my Angular cli to 7.3 I have installed yarn to try and help as well as tried to create a new application and remove files to drag and drop files that where not there like the node modules, and I am still getting this error.
How do I get this error removed so that I can see the file?
Check your build per-requisites, as illustrated by blove/ngrx-tour-of-heros issue 2
Breaking changes - node => 10
ERROR - "json-server requires at least version 4 of Node, please upgrade"
if your node -v is greater than 10, npm upgrade json-server
Appears that node-sass was optional on yarn install.
Had to install separately - yarn add none-sass
Also, cd client and cd server are reversed in lines 13 and 15.
The angular project is in de client directory, so after cloning the repo you have to get into the client directory before running the ng serve command:
git clone https://github.com/blove/ngrx-tour-of-heros.git
cd ./client
yarn install
npm run start
Seems like it's an older repo with Angular v5 and CLI v 1.6 - try downgrading if it doesn't work. https://github.com/blove/ngrx-tour-of-heros/blob/master/client/package.json#L32

How do I fix an error: Unknown plugin "flow-react-proptypes" in react native?

I'm trying to use https://github.com/jacklam718/react-native-action-sheet-component in a react-native project and am getting the following runtime error
Unknown plugin "flow-react-proptypes" specified in
"node_modules/react-native-action-sheet-component/.babelrc.env.development
I tried yarn add babel-plugin-flow-react-proptypes -D but that didn't seem to fix it.
React-native version 0.41.2, iOS
Im not familiar with yarn but from that repo packaje.json we can see that babel-plugin-flow-react-proptypes is listed as devDependency so it won't get installed when installing the package from npm.
Try installing it in your node_modules folder (if that's not what you already did with yarn) or go into node_modules/react-native... And execute npm install.

Ionic 1.x - from bower to npm

I used to install plugins in my ionic 1 project with bower. The new trend, especially with ionic 2, is to install packages with npm. Some core packages, such as ionic.cloud are not provided at all anymore with bower, even for ionic 1.x.
So I need to migrate some packages to npm. What is the recommended way to do so ?
My problem:
"npm install" seems to install packages in the "my_project/node_modules" folder, unlike bower which installs packages directly in my_project/www/lib/
As explained for instance in the installation guide of ionic.cloud this requires an additional step to copy the newly installed npm package in the lib folder with the command:
cp node_modules/#ionic/cloud/dist/bundle/ionic.cloud.min.js www/lib
However, when I update the package and run "npm update", this will update the node_modules folder, but not the lib folder. This is a problem as only the files from my lib folder are included in my index.html.
Running the cp-command after each npm update does not seem such an elegant solution. What is the recommended way to deal with this?
I think you can reverse this make the .bowerrc file create your packages inside the node_modules folder and use this path as default. Otherwise the node_modules is mandatory there is no way around creating it.
Even you can npm i --prefix ./bower_components/ <package> you still need to cp to folders up from bower_components folder

How can I update to the not yet officially released Ionic 1.2?

Ionic 1.2 has been announced:
http://blog.ionic.io/announcing-ionic-1-2/
The source code is availible here:
https://github.com/driftyco/ionic/releases/tag/v1.2.0
But I haven't been able to install with with some shell commands that I have attempted:
$ bower install --save ionic#1.2.0
$ bower install https://github.com/driftyco/ionic/archive/v1.2.0.tar.gz
$ bower install driftyco/ionic-bower#v1.2.0 --force
I can download the source code but don't know how to use it to update my ionic framework
You can install it with bower using:
$ bower install ionic#1.2.0 --force
Anyway, you should take into account that this will only download libraries and source code, but not a CLI tool.
So in my opinion, if you want to test ionic 1.2, you should
Create an ionic project (as usual)
Perform bower install ionic#1.2.0 --force, in order to get the new ionic libs
Replace in your project the content of www/lib/ionic/ with the content of the recently downloaded bower_components/ionic/release/.
DETAIL: Ionic uses to include a .bowerrc file that causes bower packages to be placed in www/lib, instead of inside bower_components, so maybe you'll simply need to replace the content of www/lib/ionic/ with www/lib/ionic/release (--force is need because www/lib/ionic already exists).

Cordova 3.0.0 - How to install a plugin

I'm totally new to app development and just started to make my first steps.
I've installed Cordova and the needed utilities according this guide.
I've created my first app (using Cordova's create script) and I'm able to run it on my Nexus 4.
Now I tried to install a plugin using plugman, and I'm stuck.
This tutorial says I can install a plugin using
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
in the application directory.
Two issues here:
1. In the application directory itself isn't a executable file named "cordova"
2. When I swtich to the cordova directory and execute the mentioned command, I get this error:
Cordova does not recognize the command plugin
Any ideas what I'm doing wrong? Or is ther a mistake in the tutorial?
Thanks a lot for any help!
EDIT:
I managed to install the plugins using plugman directly using
plugman install --platform android --project . --plugin
https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
But nevertheless I'm still interested in how to install the plugins using cordova...
Below are several ways I've used to install plugins from Cordova CLI, hope it helps:
Firstly, make sure you've installed cordova correctly(please refer to official document if needed):
cordova -v // should print something like "3.5.0-0.2.6"
Install from Cordova plugin registry
cordova plugin add org.apache.cordova.device
This should cover most cases and here is a list of plugins available in Cordova Plugin Registry.
Install from a remote repository, typically from GitHub
cordova plugin add https://github.com/brodysoft/Cordova-SQLitePlugin
If you encountered something like "Error: Command failed: error: Failed connect to help.github.com:443; Connection refused while accessing", typically it's a proxy issue, you could retry after config your proxy:
git config --global http.proxy http://user:password#proxy:xxx
If it still not works, you could click "Dowload Zip" from github, unzip the downloaded file and then:
Install from a local directory
cordova plugin add /path/to/directory
It will look in this directory and each of its subdirectories for the plugin.
NOTE: this is related to Android platform of cordova 3.4 on my windows 8 machine (tested)
step 1=> Install plugman by command in cmd "npm install -g plugman" (note that you must have node installed)
step 2=> Download git from http://msysgit.github.com/ for windows (15 mb) install exe file
step 3=> create new variable in enviorment variable name = GIT_PATH and value= "C:\Program Files (x86)\Git (this is mine urs may be diff)", now append %GIT_PATH% in Path variable (very Important) check git command in cmd if no error than continue otherwise fix this now
step 4=> Now go to http://plugins.cordova.io/#/ find whatever plugin want to install. and get just this repository url like
step 5=> now whatever and anywhere project is, place following command in cmd
**plugman install --platform android --project F:\my17app\ --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git**
Step 7=> If it successfully install we can see in app/res/xml/config.xml file a new feature will be added with id of new plugin
PS: For environment variables see in control Panel=> System and Security => System =>Advanced System Security
I did it in this manner
D:\phonegap\hello>plugman install --platform android --project D:\phonegap\hello
\platforms\android --plugin org.apache.cordova.battery-status
where as for doing it from git
plugman install --platform android --project D:\phonegap\hello
\platforms\android --plugin https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git