Invalid Version: Ember-Cli-Babel

我只是一个虾纸丫 提交于 2020-01-05 07:17:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!