l am trying to run ionic on my mac. l am currently on EL Capitan. l have installed the ionic CLI,npm and ionic itself by following the instructions on the ionic home page. l get the response -bash: ionic: command not found everytime l run ionic start sample or ionic start sample tabs .
Did you used this in the command-line-interface:
sudo npm install -g cordova ionic
Maybe something went wrong through the installation
I added 'C:\Users\usr\AppData\Roaming\npm' in my path and its works very well
l resolved this issue weeks after posting this in 2015, thought l post an answer to anyone who might need it.
It was all to do the path for the node modules. So to resolve it l added the node module path to mt profile and it worked.
Happy coding.
check path variable in your environment variable. you must add the address of npm in path variable you can find it in c:/user/xxxx/appdata/roaming/npm.
Related
I got a new laptop and I installed node, ionic and angular. I added ANDROID_SDK_HOME, ANDROID_HOME and JAVA_HOME in environment. ionic version is 6.20.2, node version is v16.17.1 and angular version is 14.2.4 and npm version is 8.15.0. When I use ionic serve, application opens in browser. But when I use ionic info, it exits without any error. Same happens when I try ionic cap build android.
I had a similar error when generating the build for Android, the command ended without any error message or warning.
After many tests it was only solved by downgrading.
npm install --global #ionic/cli#6.20.1
Hello dear community currently I work on my portfolio but with the version 4 of ionic I manage not to generate a new page by typing the command ionic generate page Contact.
Someone could help me
Voila l'erreur aprés avoir lancer la commande :
$ ionic generate page realisations
ng generate page realisations
Could not find module "#ionic/angular-toolkit" from "C:\wamp64\www\fil_Rouge\portfolioV4".
Error: Could not find module "#ionic/angular-toolkit" from "C:\wamp64\www\fil_Rouge\portfolioV4".
at Object.resolve (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\core\node\resolve.js:141:11)
at NodeModulesEngineHost._resolvePackageJson (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\schematics\tools\node-module-engine-host.js:28:21)
at NodeModulesEngineHost._resolveCollectionPath (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\schematics\tools\node-module-engine-host.js:69:40)
at NodeModulesEngineHost.createCollectionDescription (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\schematics\tools\file-system-engine-host-base.js:111:27)
at SchematicEngine._createCollectionDescription (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\schematics\src\engine\engine.js:147:40)
at SchematicEngine.createCollection (C:\Users\Stagiaire\AppData\Roaming\npm\node_modules#angular\cli\node_modules#angular-devkit\schematics\src\engine\engine.js:140:43)
So it looks like there are a bunch of missing modules from your ionic installation. I recommend uninstalling ionic globally, re-installing it and then starting a new project. After that, move into the directory of the new project and come back with the output of the ionic info command.
Commands for reference:
npm uninstall -g ionic (Uninstalling Ionic from machine)
npm install -g ionic (Installing it globally)
ionic start blank myApp (starting new app)
cd myApp (change directory to application Mac/Linux/Windows Powershell)
ionic info (Get ionic information )
I have a issue using ionic on my mac. I've cloned my repo and started it with ionic serve. But if I use control C and stop the command ant start it again I get this error "Cannot read property 'IONIC_CONFIG_DIRECTORY' of undefined".
Same problem here. Found the solution: https://forum.ionicframework.com/t/ionic-commands-not-working-after-update-ionic/146492/3
Solution:
npm uninstall ionic cordova
npm install ionic cordova
Senario
I recently upon running an Ionic 3 app, updated (well accidentally) the Ionic CLI version. Now upon running the build from command line, it produces the following error every time and halts the build:
In the error message it says to disable the gulp integration by running the command ionic config set gulp.enabled false which I did. But still getting the same error. I also tried to add the command to the start script of package.json to no avail (not needed though since it seems the config is set globally).
Any help would be appreciated.
Ionic CLI version: 3.9.2
Finally figured out what the problem was. Even if Gulp integration has been disabled with the command ionic config set gulp.enabled false, as long as Gulp is a Dev dependency (i.e. there is a reference to it in the package.json under devDependencies) the Ionic CLI would (well, logically) assume that the Ionic project has a dependency on Gulp, therefore would throw the error (see original post).
Solution
The solution for a case where you don't want Gulp integration, apart from disabling it by running the command ionic config set gulp.enabled false, is to also make sure Gulp is NOT under the devDependencies in the package.json file.
Hope this helps anyone else with a similar issue.
NOTE: Not sure from which version onwards Ionic requires integration with Cordova and Gulp in the shape of ionic.config.json file. Anyway, the above solution will be relevant for a similar case in any of those versions.
When I add a plugin to a 3.0.0 phonegap project with an android platform, I have an error eventhough a bunch of files for the plugin are added. In addition to that error when I add it, the Android manifest never gets updated with the right authorizations.
$ cordova plugin ls
No plugins added. 'Use cordova plugin add <plugin>'.
$ sudo cordova plugin add "http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git"
{ [Error: ENOENT, no such file or directory '/tmp/plugman-tmp1375200648427/*/plugin.xml']
errno: 34,
code: 'ENOENT',
path: '/tmp/plugman-tmp1375200648427/*/plugin.xml',
syscall: 'open' }
$ cordova plugin ls
[ 'org.apache.cordova.core.media-capture' ]
I was having the same problem with the Connection plugin. Once I changed from "cordova plugin add" to "phonegap local plugin add", it worked fine.
$ phonegap local plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-media-capture.git
I had the same problem, after some debugging and testing I finally solved the problem:
Open
C:\Users\<user>\AppData\Roaming\npm\node_modules\cordova\node_modules\plugman\src\util\plugins.js.
Find var cmd = util.format('git clone "%s" "%s"', plugin_git_url,
path.basename(tmp_dir)); (line 42 ATM)
Replace it with var cmd = util.format('git clone "%s"
"%s"', plugin_git_url, tmp_dir);.
This will make git clone clone to the absolute tmp path instead of the relative.
I received a similar error. I resolved the issue by removing the media-capture plugin, installing the file plugin, then reinstalling the media-capture plugin
cordova plugin rm org.apache.cordova.media-capture
cordova plugin add org.apache.cordova.file
cordova plugin add org.apache.cordova.media-capture
Maybe media-capture is dependent on the file plugin.
I was also facing the same error :
Suppose if you want to add camera plugin then instead of giving:
cordova plugin add cordova-plugin-camera
use
phonegap plugin add cordova-plugin-camera
and then it will work fine
It turns out i had something really strange with my proxy. Possibly some data compression on the fly which made the data corrupt. Tethering from the phone solved the issue, after completely uninstalling cordova.