问题
Tried upgrading my ember project from ember 2.12.2 to 2.13.2 but I get the following error when I run ember init
Invalid Version: https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-6.1.0.tgz
TypeError: Invalid Version: https://registry.npmjs.org/ember-cli-babel/-/ember-cli-babel-6.1.0.tgz
at new SemVer (/Users/code/website/node_modules/semver/semver.js:293:11)
at Range.test (/Users/code/website/node_modules/semver/semver.js:1036:15)
at Function.satisfies (/Users/code/website/node_modules/semver/semver.js:1085:16)
at Class.Addon.(anonymous function) (/Users/code/website/node_modules/ember-cli/lib/models/addon.js:1547:25)
at Class.init (/Users/code/website/node_modules/ember-cli/lib/models/addon.js:234:57)
at Class.superWrapper [as init] (/Users/code/website/node_modules/core-object/lib/assign-properties.js:34:20)
at Class.CoreObject (/Users/code/website/node_modules/core-object/core-object.js:9:15)
at Class (/Users/code/website/node_modules/core-object/core-object.js:21:5)
at Class (/Users/code/website/node_modules/core-object/core-object.js:21:5)
at graph.topsort.vertex (/Users/code/website/node_modules/ember-cli/lib/models/addons-factory.js:55:21)
Yet when I run npm install ember-cli-babel
I still get the error but I also get that the current version is ember-cli-babel@5.2.4
What can I do to fix this?
回答1:
So this took a few days but I figure I would document it properly since Ember-Cli docs don't go into it too deep.
When upgrading Ember project before ember init
I had to delete my package-lock.json
file then delete all node_modules
. Run npm install
and then ember init
to run through rewrites/diffs in my code.
回答2:
When using ember 2.13 you need to upgrade ember-cli-babel to version 6.0.0 or higher . Check your package.json file and update it. If you have problems please include your package.json file in your question above.
If it does not work, try to remove your node_modules
folder and reinstall your dependencies with npm install
.
来源:https://stackoverflow.com/questions/44664737/invalid-version-ember-cli-babel