Node module errors while Ionic Serve - node.js

Everything working well but I don't know what happened, Now when I trying to hit Ionic Serve command it gives error and I have tried with different ionic version and node and npm version to fix the error but the issue remains same even I have tried to start from the fresh project but still no luck. I have attached the error page If anyone helps me it will be really grateful.
Versions that I have installed in my system -
Node = v10.15.3
Npm = 6.4.1
Ionic = CLI 4.12.0

Delete your node module folder which is inside your project then open your terminal and got to inside your project and use this following command "npm install --force" then "npm rebuild node-sass --force".

Related

running npm install #nuxtjs/sentry doesn't work with node version v16.15.0

I recently switched my laptop and cloned my project which was already working fine on the other laptop, when I installed node js in new laptop with version v16.15.0 and tried running "npm install" in my nuxt project as you can see in screen shot below. and gives error while installing #nuxtjs/sentry
also removing sentry package from package.json and nuxt.config.js and then running npm install to have all other dependencies works just fine.
And running "npm install #nuxtjs/sentry" gives the same error too.

Error during npm start/expo start on expo reactive native Project

I am trying to run react native expo, it installed (via 'npm install -g expo-cli') globally and I created Project ('expo init react-project') and works fine. But i wend inside folder and run npm start / expo start , appears Errors as shown in picture. I also get Error on 'expo'.
I also deleted node_modules Folder and reinstall it (npm install) but didn't help.
Like you can see in Images, I have latest node,npn and Git versions. And its strange that , although I have installed expo globally, i get expo version on E:\ but not in subfolder (detail in screenshots).
Could anybody help me out?
Error on expo:
Error on npm start / expo start:
Latest Versions:

Could not find module 'json-schema' while installing angular cli using npm

I am getting this error:
I am not able to install the angular cli using npm. I am getting the "cannot find module 'json-schema'" error. I tried reinstalling the node js and npm with the latest versions. But the error didn't resolve. Please help me with this.
This issue has a fix in the link below:
https://github.com/kriszyp/json-schema/issues/29
Good Luck
I uninstalled and installed node/npm/angular-cli many times. Finally did a "where ng" on my windows pc, and found the executable was under the %appdata%\npm directory. So after uninstalling node, deleting the %appdata%\npm directory, reinstalling node, and 'npm install -g angular-cli', the ng new and ng serve commands started working.

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

Couldn't find ionic.config.json file. Are you in an Ionic project?

I am new to Ionic and trying to run ionic serve to test my application but I keep getting this error:
Couldn't find ionic.config.json file. Are you in an Ionic project?
On running ionic info, I get the following:
$ ionic info
******************************************************
Dependency warning - for the CLI to run correctly,
it is highly recommended to install/upgrade the following:
Please update your Cordova CLI to version >=4.2.0 `npm install -g cordova`
******************************************************
Your system information:
Cordova CLI: undefined
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.1.7
OS: Windows 7
Node Version: v4.4.5
Tried it with Couldn't find ionic.config.json file but couldn't resolve the issue.
I am also getting this trace while creating an application with ionic start myApp tabs:
Installing npm packages (may take a minute or two)...
Error with start Error: spawn UNKNOWN
at exports._errnoException (util.js:870:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at spawn (C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\ ionic-app-lib\node_modules\cross-spawn\index.js:17:18)
at Object.runSpawnCommand (C:\Users\user\AppData\Roaming\npm\node_modules\io nic\node_modules\ionic-app-lib\lib\start.js:56:17)
at C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-a pp-lib\lib\start.js:104:20
at _fulfilled (C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_mod ules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\user\AppData\Roaming\npm\node_modules \ionic\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\user\AppData\Roaming\npm\node_m odules\ionic\node_modules\q\q.js:749:13)
at C:\Users\user\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js: 557:44
Can someone please help here.
I think your first machine have ionic version < 2.0.0, the other one >= 2.0.0
If you found file named
ionic.project rename it to ionic.config.json
Hope this will help you.
Create an ionic.config.json file manually in your project folder. Copy below mentioned code in this file:
{
"name": "Replace with your project name",
"app_id": "",
"v2": true,
"typescript": true
}
perform an npm install to ensure all node_modules are updated. This worked for me
After creating your new project, you need to step into the projects folder, in there you will find the config file and you can run ionic serve.
$ ionic start myApp tabs
$ cd myApp
$ ionic serve
Be sure that you are running last version of ionic and cordova.
install ionic using.
npm install -g ionic#latest
or
refer link : http://ionicframework.com/docs/guide/installation.html
As per logs you are getting Cordova CLI: undefined. Seems like an issue with CLI installation. Try reinstalling and that should solve your problem.
I would suggest you to start the fresh installation. And remove existing cordova and ionic
install cordova & ionic with npm install -g cordova ionic
Then install the template ionic start --v2 myApp tabs
Check out this link https://ionicframework.com/getting-started/
I had the same issue here is what I did.
Mac steps
sudo npm install npm -g
sudo npm install -g cordova
Restart your computer also. I was receiving deprecated minimatch#2.0.10 warnings prior to the restart.
Windows steps
Redownload Node.js by going to here
After download npm and Node.js will be updated as they are packaged together in the download.
sudo npm install -g cordova in Command prompt window.
Run cordova --version to make sure you are all set
Restart your computer.
This should resolve the issue hopefully.
I tried this and i was able to resolve my own issue with the ionic.config.json file. Try to update your graceful-fs file by running this command:
npm install -g graceful-fs graceful-fs#latest.
After running the command, try to create your project again by running the ionic start myApp. Where 'myApp is the name of the folder you want created for your project. This should work for you.
Make sure your node version is above v6. Then in the root of your ionic project run ionic info.
It should give you a prompt something like "Looks like this is an Ionic Angular project, would you like to install #ionic/cli-plugin-ionic-angular and continue?"
Type yes
It should have ran the following command for you: npm install --save-dev --save-exact #ionic/cli-plugin-ionic-angular#latest
Now you can run ionic serve and it will work.
p.s above is from my experience, had the same issue and the above sorted it out. Hope this is useful.
Check if you are not in project directory and try
ionic serve
And If you found file named ionic.project rename it to ionic.config.json

Resources