imooc-lego / imooc-cli Goto Github PK
View Code? Open in Web Editor NEW慕课网前端统一研发脚手架
慕课网前端统一研发脚手架
源码中的版本比较是
versions.sort((a, b) => semver.gt(b, a))
这么比较是存在问题的,semver.gt返回的boolean类型的true和false,而sort函数规定的确是数字:
大于0:b置换a
等于0:a与b位置不变
小于0:a置换b
这种比较只会发生b置换a,但却没有a置换b的场景,导致版本比较失败。
step
D:\nodejs\node_global\node_modules\@imooc-cli\core\node_modules\_@[email protected]@@imooc-cli\utils\lib\Git\Git.js:120
prepare = async () => {
^
SyntaxError: Unexpected token =
at new Script (vm.js:80:7)
at createScript (vm.js:274:10)
at Object.runInThisContext (vm.js:326:10)
at Module._compile (internal/modules/cjs/loader.js:664:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.