How can I Resolve This error on Ionic 5 ( - ionic-framework

I am trying to workring with Arima on Ionic, but I get this error

Delete node-modules folder and package-lock.json from your project.
Run the below command on root project directory.
npm install --force
and try running again.

Related

"Fixing missing packages and vulnerabilities in age-viewer package when installing from GitHub"

I am trying to install the age-viewer from GitHub by following these steps:
Cloning the repository
Changing directory to age-viewer
Running "npm run setup"
However, I am encountering issues with missing packages and 34 vulnerabilities (3 moderate, 22 high, 9 critical). I have attempted to resolve this by running "npm audit fix --force", but it did not work.
I am looking for a solution to fix the missing packages and vulnerabilities in the age-viewer package that I am trying to install from GitHub.
Cloning the age-viewer repository from GitHub
Changing directory to age-viewer
Running "npm run setup"
Running "npm audit fix --force" to resolve issues with missing packages and vulnerabilities
I encountered a similar error. Here is how I solved it:
Removed node_modules directory from root, frontend and backend folders.
Removed package-lock.json from root, frontend and backend folders.
Ensured node version is in range 14.16.0 - 14.21.2 (I switched to 14.16.0 using nvm)
Cd to root dir of the AGE-Viewer
npm run setup
npm run start
Hope this helps.
This error can arise due to a different reason. You can try some of the following steps to solve this error.
Try using node version 14.16.0.
If you are using WSL then make sure that the node version for your system's parent os and WSl is the same.
I had the same issue while installing, the 1st solution mentioned above worked for me [for ubuntu 22.04].
Try to use 14.16.0 version of node.
But if you are already using this version then try these steps:
npm cache clean --force
delete node_modules folder and package-lock.json file from your age-viewer root
directory.
delete node_modules folder and package-lock.json file from the frontend folder in age-viewer directory.
delete node_modules folder and package-lock.json file from the backend folder
in age-viewer directory.
npm run setup
npm run start
It works for me like this.

How can we build an ionic project in Ubuntu 18.04, which is developed and built in windows environment?

i am trying to build an ionic project in ubuntu 18.04. but I am getting an error like it cannot build in ubuntu environment.
I have rebuild node-sass folder as well. After that I am getting error as gulf.file cannot find.
here is the error i am getting
copy files from your old project folder except node_module
then paste them in the new path
run
if cordova not installed
npm install -g cordova
then run
npm install -g ionic
npm install
if any error shows
run
npm audit fix

Error whith ionic 3

I'm having this error with Ionic 3 for any command I launch even ionic -v
Error
at FatalException.Exception (/usr/lib/node_modules/ionic/node_modules/#ionic/cli-utils/dist/lib/errors.js:8:23)
at FatalException (/usr/lib/node_modules/ionic/node_modules/#ionic/cli-utils/dist/lib/errors.js:17:9)
at Config. (/usr/lib/node_modules/ionic/node_modules/#ionic/cli-utils/dist/lib/config.js:60:35)
at throw (native)
at rejected (/usr/lib/node_modules/ionic/node_modules/#ionic/cli-utils/dist/lib/config.js:5:65)
name: 'Exception', exitCode: 1, fatal: true
I tried uninstalling ionic then reinstalling but the error persisted.
Any help or recommendation would be very much appreciated.
Check the ionic config.json file, great chance it is empty or corrupt based on this error. To get to the file location do the following.
Open up your terminal and go to your root directory
cd /
Next get to the .ionic folder.
cd Users/<User>/.ionic
Once here check the config.json to see its contents. Like I said it is most likely empty or corrupt so go ahead and delete it, then reinstall Ionic and that should fix your issue.
Possibly try npm prune which removes unnecessary node file relative to you project
If all else fails then rm -rf node_modules then npm install(be careful with this as it clears all npm data)
delete node_module folder and re-run npm install command , it works .

Ionic 2: How to update Ionic library for an existing project?

Can't find any info on Ionic 2 website. For example, a project is created with Ionic library 2.0.1. How do I update it to Ionic library 2.1.0? What is the standard procedure? ionic lib update is deprecated.
If you want to update your CLI, you need to run:
npm install -g ionic#latest
For updating your project, open your package.json and update the version of ionic-angular entry and any other dependencies that need to be updated. Reference to a package.json is here which is the one that is downloaded when you start a new project.
Then delete your projects node_modules and run:
npm install in your project directory.
You can also go to your project directory and type:
npm install ionic-angular#latest --save
npm install #ionic/app-scripts#latest --save-dev
In my case, npm install -g ionic#latest installed globally the latest ionic but it didn't update the ionic version of my project. Only the above solution worked.
PS 1: I'm using ionic 3
PS 2: Delete the project's folder node_modules, in case of errors

Ionic framework - 'ionic' is not recognized as an internal or external command

I was trying to install ionic and create a sample project on it since morning. But, was facing a series of issues since then. Tried solving them one by one. Atlast restarted my machine and opened command prompt to build the sample project and tried
path of the sample project> ionic build android
But, i kept on facing the error that states 'ionic' is not recognized as an internal or external command.
I tried clearing the cache and reinstalling ionic in my machine. Still, I face the same issue of ionic is not recognized as an internal or external command.
Can somebody help me out on this issue?
Thanks
Manikandan J
Somehow , my npm path was not there in PATH environmental Variable
So after adding C:\Users\XXXXX\AppData\Roaming\npm to my PATH variable my problem solved :-)
Try to install the ionic framework with the -g parameter, so the installation will be globall, like this:
npm install -g ionic
-g parameter mean "its binaries end up in your PATH environment variable."
If you're on Windows 10 (and possibly Vista/8/8.1) you need to run cmd.exe as an administrator. Now when you run the commands below, your environment settings will be made.
npm install -g cordova ionic
Check if the configuration is broken or not. the update might have installed it in the wrong place.
First check: npm config get prefix
In my case It wasn't set to /usr/local but in /usr/Roaming.
So to fix it, use: npm config set prefix
Problem solved! :)
After several hours of struggle I fixed it by the below steps:
uninstall node js restart the system .
install the node js (current version).
check your node js path in System variable in an
environmental variable.
Right click the command prompt and select run as administrator. Type cd\ now get into the npm path folder by cd <YourNpmPath>\npm install -g ionic#4
That's it . Now it is globally available throughout the system.
I ran this command to uninstall:
npm uninstall -g ionic cordova
and then ran the install:
npm install -g ionic cordova
and then everything started working again.
Insert this into your system path. This happens because node modules are not seen but when you do this you make the path to the module. They are found in this location
C:\Users\[username]\AppData\Roaming\npm
Below simple steps to follow to get it working:
install Node.js
Install Ionic and cordova : npm install -g cordova ionic
create a simple project: ionic start mySimpleApp tabs
cd mySimpleApp
ionic cordova platform add android
Build the project: ionic build android
For the benefit of searchers, the other answers didn't work for me.
I deleted the 'Ionic' folder from:
C:\Users\..{me}..\AppData\Roaming\npm\node_modules
Then installed again with:
npm install -g ionic cordova
That fixed it.
I solve the problem on windows 10.The problem was that the environment variables don't contain a path to the ionic folder.
Just do:
npm config set prefix
And then
npm install -g ionic cordova
setting the path variable to C:\Users\«user name folder»\appdata\Roaming\npm helped me to resolve the issue. Please try
uninstall the old version
npm uninstall -g ionic
and try to install it again with the new version
npm install -g #ionic/cli
In my situation, I thought Ionic did not install,
but after I had changed my Windows User-Name, npm did for some reason still install on the last %AppData% folder path.
for example correct-path for new user-name is:
C:\Users\Admin\AppData\Roaming\npm
but npm did use:
C:\Users\Abc\AppData\Roaming\npm
have moved that folder contents to the right place and all just works!
But to finally fix the issue from its root cause I updated NPM settings like:
npm config -g set prefix "%AppData%\npm"
npm config -g set cache "%AppData%\npm-cache"
npm config -g get prefix
And ensured my PATH environment-variable includes the correct NPM directory.
This issue occurs when we change the path variables manually.Because of this change system doesn't find libraries for the command which needed to be executed.
While installing ionic cordova, ionic cli takes cares by adding path variable in your environment.Hope this content helps
path -
C:\user\system_name\AppData\Roaming\npm
I had the same problem on Windows, and I find solution by navigating the command prompt to
C:\Users\[username]\AppData\Roaming\npm>
Cordova, Ionic, etc. are found here.
The following steps worked for me in 2022:
Run the command prompt as Admin. This is mandatory to ensure that ionic is installed globally, otherwise you would continue to see the same error message despite installing ionic.
Type this command and hit enter: npm i -g #ionic/cli
That's it!
'ionic/java/cordova etc..' is not recognized as an internal or external command
for ionic or cordova install it from node using npm install -g ionic/cordova command.
This kind of messages comes whenever its PATH not set properly for other programs like java. System has to recognize your command available on your system or not. This can be identified only when you set your environment variable.
use this for setting your path
SET PATH = %PATH%; your app path to bin
Just follow this video, you have to set your path correctly.
http://learn.ionicframework.com/videos/windows-android/
1: Download and Install Java then open your system environment variables, and add to or create a new user variable called PATH with the full path to the bin folder of the new Java SDK installation.
2: Download Apache Ant then add the full path to the bin/ folder to the end of your PATH environment variable.
3: Add Android to PATH :Open up your environment variables setting and add the full path to both the adt-bundle/sdk/platform-tools/ folder and the adt-bundle/sdk/tools/ folder to the end of your PATH variable:
4.Install nodeJs and now you can do
npm install -g cordova ionic
I started getting this same error in the Console2 command prompt. I checked the environment variables and reinstalled ionic and cordova but this did not fixed it.
I then tried ionic in Node.js command prompt and it worked perfectly. So if you follow the other advice and it still doesn't work, try a different command prompt.
I think you should copy the bin file to the system variables and it should be fine, at least I try it on Win7 and it worked. I also got the same prob like this before.
Right click Computer, choose Properties, Advanced system settings and edit environment variables.
Try reinstalling the ionic
npm install ionic -g
uninstall ionic npm package and then clear all npm cache in appdata and then install ionic
npm install -g ionic
ionic info
you must install ionic package has global so use -g.
ionic info command is used to check the ionic information
Well, after trying several answers from many posts like this one and realizing that my environment variables were there too, I ran the
npm install -g cordova ionic
from the inside of nodejs folder in Program Files with windows prompt as administrator.
Initially I was installing it in my dev folder in D:\ partition. Hope it helps someone.
Probably you doesn't have ionic installed in your device.
First check in terminal/cmd, have you installed ionic or not?
you can check it with following command:
ionic -v
C:\Program Files\nodejs\bin
try adding this to your user and environment variables, under environment variables, and then close the command prompt window and open.
I got my problem resolved :)
npm install -g cordova ionic
and then
ionic start myApp tabs
and then
cd myApp
ionic serve
Firstly uninstall the ionic module from the project by using the following command.
npm uninstall -g ionic cordova
Then install ionic and cordova dependencies seperately as follows.
npm install -g ionic
npm install -g cordova
Please check whether ionic cli is installed or not globally and locally both
Node versions
Check if you are using the nvm,
you would have installed the ionc cli with node version 14.X, and now you might be using node 16.X or latest, this is why the ionic cli is not working in latest node version.
check list of node versions if by using nvm:
nvm list
try changing the node version to previous,
NVM user older node
change to older nvm:
nvm use 14.x.x
or your version in list