Reputation: 918
EDIT : It seems to work when I run C:\Program Files\nodejs\nodevars.bat prior to do anything. A permanent solution would still be enjoyable though.
EDIT 2: The solution that works for me is to add C:\Users{username}\AppData\Roaming\npm prior to C:\Android\npm in the PATH variable, and then to restart the command prompt.
I'm trying to install Ionic on Windows 10, and I cannot run it. I get the error message: "Ionic is not recognized as an external or internal command".
I already had Cordova installed because I was testing jQuery Mobile, and I think for this reason, I may have some strange things happening in my PATH environment variable. Here is how it looks like:
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps;%ANT_HOME%\bin;%JAVA_HOME%\bin;%ANDROID_HOME%\platform-tools\;%ANDROID_HOME%\tools\;C:\Program Files\nodejs\;C:\Program Files\nodejs\node_modules\npm\bin\;C:\Users\Pierre\AppData\Roaming\npm\;C:\Android\npm\;C:\Android\npm\node_modules\cordova\bin\;
When I run cordova -v, it works, showing that Cordova is installed properly (also I know it because I run it correctly with jQuery Mobile).
I tried to clean the npm cache and install ionic again, both with and without the administrator status, and it didn't change anything. Here is the output when I run npm install -g ionic:
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue.
npm WARN deprecated [email protected]: use uuid module instead
npm WARN deprecated [email protected]: use uuid module instead
C:\Users\Pierre\AppData\Roaming\npm\ionic -> C:\Users\Pierre\AppData\Roaming\npm\node_modules\ionic\bin\ionic
C:\Users\Pierre\AppData\Roaming\npm
`-- [email protected]
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\ionic\node_modules\chokidar\node_modules\fsevents):
npm WARN potsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN In [email protected] replacing bundled version of cross-spawn with [email protected]
npm WARN In [email protected] replacing bundled version of semver with [email protected]
npm WARN In [email protected] replacing bundled version of mime-types with [email protected]
npm WARN In [email protected] replacing bundled version of form-data with [email protected]
npm WARN In [email protected] replacing bundled version of request with [email protected]
npm WARN In [email protected] replacing bundled version of ionic-app-lib with [email protected]
I have a lot of warnings, but I don't know if it is related at all. Thank you for your help.
Upvotes: 1
Views: 3498
Reputation: 11
install ionic run bellow command in your cmd npm install -g ionic
Upvotes: 0
Reputation: 597
Are you sure Ionic and Cordova are included in your PATH? I recently re installed Ionic and Cordova and had much troubles having it to work. Some say Cordova and Ionic are supposed to be automatically included in the PATH when installed, but I noticed that it doesn't. You should add this line to your PATH: c:\users\yourname\AppData\Roaming\npm\
Upvotes: 5