最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to create a react project with specific version of create-react-app? - Stack Overflow

programmeradmin1浏览0评论

I need to create a new react application with create-react-app version 1.0.10. However, when I do create-react-app myProject it automatically uses the latest version of create-react-app available at that time. Is there any mands available to make create-react-app use a specific version to create a project template?

I need to create a new react application with create-react-app version 1.0.10. However, when I do create-react-app myProject it automatically uses the latest version of create-react-app available at that time. Is there any mands available to make create-react-app use a specific version to create a project template?

Share Improve this question asked Aug 6, 2017 at 8:01 Dani AkashDani Akash 7,1063 gold badges37 silver badges48 bronze badges 4
  • Did you try installing 1.0.10? npm install [email protected]? Most likely it's installed globally so you'd have to install it locally and then run it from there. – Henrik Andersson Commented Aug 6, 2017 at 8:03
  • you mean installing it locally in a project? – Dani Akash Commented Aug 6, 2017 at 8:27
  • 2 create-react-app is a global package, so you have 1 version of that package installed globally on your machine and wherever you are in your puter, you can type create-react-app myProject. As @HenrikAndersson suggested, if you install globally a specific version: npm -g install [email protected] every time you use it, it's going to be that version – maxgallo Commented Aug 6, 2017 at 9:17
  • You could specify "create-react-app":"1.0.10." in package.json, and then do "npm install" and then it should install the package for you(note this is without the package being installed already). – Dream_Cap Commented Aug 6, 2017 at 9:30
Add a ment  | 

1 Answer 1

Reset to default 5

You will need to run:

npm install --save --save-exact [email protected]

or

yarn add --exact [email protected]

this will only work in in a project that has not been ejected yet, read this for more info

发布评论

评论列表(0)

  1. 暂无评论