Ionic2 app moved from mac to pc causing build issues - node.js

I moved my ionic2 app from mac to windows pc with nodemodules and tried to run using npm run android, but getting an error as shown below
Here is my ionic info:
Your system information:
Cordova CLI: 6.4.0
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.1-201610241941
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.31
OS: Windows 7 SP1
Node Version: v6.2.0
I ran following commands:
npm uninstall ionic
npm cache clean
npm install -g ionic#latest
but still ionic-app-scripts is not recognized in my cmd. What am I doing wrong here? It works great in my mac but moving to pc, I'm frustrated.
Any advice would be helpful. Thank you.
Here is my project repo, If I cloned the same app from my repo it's building fine but moving the source code not working.
Update #1
Now getting a different error.

I add this answer just in case so other SO users with the same issue could find the answer easier. Just like #nyluje recommends in this post, to fix
Cannot read property 'AssetUrl' of undefined
you should take away "^" sign in front of "dependencies" and "devDependencies" in package.json, and run npm install again.

Related

expo init not working because of nodejs version

I was watching https://www.youtube.com/watch?v=0-S5a0eXPoc
It's a React Native tutorial video.
I have installed expo-cli and tried to run
expo init projectName
But this is failing because of the below issue
Can anyone help me on this issue. What do I need to do here?
I am using Windows 10 laptop and my current node version is v13.12.0 and npm version is 6.14.4

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

Got error while installing Cordova/Ionic in Windows PC

I am new in Mobile Development and I have just starting to learn Phonegap and Ionic to make Mobile Application.
But, while installing the Ionic Framework in my Windows 7 PC I am getting following errors:
Your system information:
Cordova CLI: Not installed
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 7
Node Version: v4.6.1
Xcode version: Not installed
******************************************************
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`
******************************************************
Node and npm already installed on my machine.
npm install -g cordova
npm install -g cordova ionic
try it.
i hope you installed node.js from nodejs.org and git files.....
1 step:
open cmd with "run as administrator"...then type npm install cordova(it will take some time to install)....
2 step:
now, npm install ionic
try it with a little bit patience...because to resolve this problem, it had took around 2 hours for me.
Thank you
This seems to be a bug with Ionic/Cordova. What worked for me was to opt into telemetry by running cordova telemetry on. I was able to run cordova telemetry off again afterwards, and the error was still gone.

Error while installing ionic framework

I have looked at the other questions and answers but still my issue is not solved.
I have successfully installed node.js
Node version: 0.12.7
NPM version: 2.11.3
Now when I install Cordova, there are some warnings but it does get installed.
After that when I try to install ionic, it shows all errors and doesn't install.
I am on a Windows machine... so I am not using the 'sudo' in the command.
I haven't also tried to install the JDK, Apache Ant and Android SDK. Are they needed while installing?
Please let me know if you want screenshots.
Thank you
In windows system there is no need to write sudo,we can use npm install -g ionic to install ionic framework
Steps to work Ionic Framework
1)you have to install nodeJS
2)you have to install Java and configure it's path in environmental variables.
3)you have to install Apache-ant
4)you have to install Android-sdk and configure it's path in environmental variables
for reference please see these links Install Ionic Framework, Ionic frameowrk on windows7,8
For any queries reply
Try running command prompt as an administrator before running the commands, that always fixed it for me.

Resources