Cannot use ionic or cordova - node.js

i installed ionic on mu Ubuntu using this:
npm install -g cordova ionic
i know i was tested that via ionic command and it was working.
but now when i try to run it using ionic i see this :
No command 'ionic' found
i tried this but that wasnt my problem.
Cannot run ionic. receives "No command 'ionic' found"

sudo ln -s /home/guy/npm/bin/ionic /usr/bin/ionic

Try
sudo npm install -g ionic
then type the code
ionic -v to check the version of ionic.
If you are able to see the ionic version, your ionic is installed.

Related

Ionic installed locally but not able to run command

I installed ionic locally instead of global with out giving -g option
But when I run command ionic start
It gives error
Frist try reinstalling it:
npm uninstall -g ionic
npm install -g #ionic/cli
Then if the error is still there, make sure you have the PATH variable set correctly! See more here
Also try to close and reopen the terminal.

Can't successfully run the command npm install --save-dev --save-exact #ionic/cli-plugin-angular#latest on ionic 3.2.0

I'm trying to set up a project using
ionic version 3.2.0
Cordova CLI: 8.0.0
Node 12.13.1 (lts)
Using Windows 10 (If it helps)
When I try to run the command ionic cordova platform add android#6.3.0 the terminal prompts me ? Looks like this is an angular project, would you like to install #ionic/cli-p lugin-angular and continue? (Y/n) and then when I press y and ENTER key the error message comes out.
Tried to run this command npm install --save-dev --save-exact #ionic/cli-plugin-angular#latest individually but the same error shows. Looked for and tried a lot of solutions but it doesn't work. This is getting very frustrating. Can Any of you guys help me?
Some solutions that I tried previously which had not effect on the error. It keeps on coming.
npm install -g #angular/angular-cli (Still prompts me to run ? Looks like this is an angular project, would you like to install #ionic/cli-p lugin-angular and continue? (Y/n) Then comes the Error)
npm set registry https://registry.npmjs.org/ (No change on the Error message)
npm install #ionic/cli-plugin-cordova npm uninstall -g ionic npm install -g ionic#3.2.0
(Same Error Pops up)
*New to Ionic & Cordova. Can Anyone help?
You could try deleting your node modules then run npm install...worked for me an ionic 3 project.

error to ionic in ubuntu 17.10.1

friends I have the following problem to install ionic
I already have correctly installed nodejs and npm
then install ionic with sudo npm install -g ionic
when I try to consult the installed version, I find the following error:
ionic –v
[ERROR] Unable to find command: –v
You may need to be in an Ionic project directory.
the strange thing is that I was able to install monaca and that works well, although monaca also uses ionic.
What I can do? Thanks
You are using a dash character (–) instead of the hyphen (-).
When I run your command (ionic –v) on Ubuntu 16.04 I get that same error, but then if I use the hyphen (ionic -v) I get the version out.

Ionic start give error: There was an error with the spawned command: npminstall

I'm trying to create a mobile app with ionic and cordova but when I launch the comand
ionic start {{appname}} blank
after the download npm give me
Error with start undefined
Error Initializing app: There was an error with the spawned command: npminstall
There was an error with the spawned command: npminstall
I can see that the download is completed because I can see the generated folders. I followed all the suggest I found on the web like update node and npm but nothing works.
Here are the version of npm, node, cordova and ionic
ionic 2.2.1
cordova 6.5.0
npm 4.4.1
node 6.10.0
Other little warning:
I don't know why after all the upgrade when i launch
ionic -v
I've got this:
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please install your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
2.2.1
even if the cordova version is > 4.2.0 but I really don't think that this is the primary problem. Any ideas?
EDIT:
I'm working on windows 7
I found the solution!
I tried to lunch the command
ionic start app blank --verbose
and as before it stopped at npminstall. The problem were that verbose doesn't told me the real problem.
I moved inside the folder downloaded by Ionic and I launch
npm install --verbose
and here he told me that the problem were the https proxy configuration.
So if the error gave by Ionic is just
There was an error with the spawned command: npminstall
just go inside the downloaded folder and launch
npm install --verbose
for check the real problem
Uninstall all (ionic, cordova, nodejs).
Install nodejs LTS version using this URL - https://nodejs.org/en/
Install ionic and cordova using this URL - https://ionicframework.com/docs/v2/intro/installation/
Also Reinstall Git and when it asks Adjusting your PATH environment select Use Git from the Windows Command Prompt.
When You install ionic and cordova open cmd as admin.
Then Run command in ionic start myApp blank --v2
I figured how to solve the dependency warning problem
cordova -v
and then you get a question like :
May Cordova anonymously report usage statistics to improve the tool over time?
say yes.then fixed warning problem.
then install npm globally
npm install -g npm
create a app without installing its packages
ionic start app --v2 --skip-npm
seems ok till now?then
cd app
install packages
npm install --save
done!try to start your ionic app
ionic serve

getting error in ionic serve in Terminal after updating nodejs

I am using ubuntu 15.10
ionic version 1.7.15.
I was trying to update my nodejs to laters version 6 and npm and after that when i run ionic server command i am getting error shown in
the command i used to update
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
how to to downgrade my nodejs
when i use whereis node command
node: /usr/local/bin/node /opt/node/bin/node
when i use whereis nodejs command
nodejs:
when i use whereis npm command
npm: /usr/local/bin/npm /opt/node/bin/npm
I think i have to use lower version of node but i dont know how to do is i have tried my cmd but no use
I solved this issue by mention the version of node
sudo npm cache clean -f
sudo npm install -g n
sudo n v4.2.3 //By mentioning the version while i install i solved this error on serve
i switched my node version from v6 to v4 so then i got no error

Resources