question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ionic CLI changing package.json version spec from ~ to ^

See original GitHub issue

Description:

Running ionic cordova run modifies version constraints of package.json so that all tilde (~) become caret (^)

Steps to Reproduce:

Run ionic cordova run (either android or ios) in your project directory

Output:

Version constraints on package.json are changed from ~ to ^

My ionic info:

cli packages: (/Users/seiyoungahn/.npm-global/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.1.0 
Gulp CLI              : CLI version 3.9.1 Local version 3.9.1

local packages:

Cordova Platforms : android 6.1.1 ios 4.5.4
Ionic Framework   : unknown

System:

ios-deploy : 1.9.2 
ios-sim    : 6.1.2 
Node       : v6.12.3
npm        : 5.6.0 
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

Other Information:

This issue is related to #2230.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
jcesarmobilecommented, Feb 1, 2018

What’s your npm save prefix? npm config get save-prefix

I created another issue a month ago about platforms being added with ~ in the config.xml but with the save-prefix in package.json (https://issues.apache.org/jira/browse/CB-13729) and at some point they sync the value changing it in the config.xml.

So, if you have ^ as save-prefix, you can set it to ~ as a workaround npm config set save-prefix='~'

0reactions
jcesarmobilecommented, Feb 1, 2018

Yeah, that was from preventing the change from ~ to ^ on first place, but once it’s changed it doesn’t revert it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Migration Guide: Documentation to Migrate Ionic 4.x to 5.x
The Ionic Migration Guide provides documentation for how to migrate an app from 4.x to 5.x. Read to learn more about what updates...
Read more >
ionic 5 conflict package.json - angular - Stack Overflow
finally I solved by installing @ionic-native/core dependency by running npm install --save @ionic-native/core.
Read more >
Updating your published package version number - npm Docs
To change the version number in package.json , on the command line, in the package root directory, run the following command, replacing <update_type>...
Read more >
HOW TO: Update all npm packages in your project at once
For those in camp TL;DR; write and execute a node script(source below) to rewrite all the versions listed in package.json .
Read more >
Platforms and Plugins Version Management - Apache Cordova
json file. It is also possible to add a platform or plugin by editing the package.json file directly, assuming you know the right...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found