# How to generate a new project using an older dfx version?

**URL:** <https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928>\
**Category:** Developers\
**Created:** [December 26, 2021, 8:02pm UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928 "2021-12-26T20:02:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [December 26, 2021, 8:02pm UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928/1 "2021-12-26T20:02:09Z")

</div>

For example 0.7.1 instead of 0.8.4.

I have the older version in my dfx cache (verified with `dfx cache list`), but there isn’t a `dfx cache use 0.7.1` or a `dfx new <project_name> --version 0.7.1` command…

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [December 26, 2021, 8:17pm UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928/2 "2021-12-26T20:17:09Z")

</div>

Can’t you just change dfx version in dfx.json?

---

<div class="post-metadata">

**Author:** ![jzxchiang](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/jzxchiang/32/2592_2.png) [@jzxchiang](https://forum.dfinity.org/u/jzxchiang)\
**Post date:** [December 26, 2021, 8:27pm UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928/3 "2021-12-26T20:27:39Z")

</div>

I could, but the initial project files (including the webpack.config.js) will still be generated using the newer version. If I then change the version in dfx.json to an older version, everything breaks because the initial project files aren’t compatible with the older dfx version.

Another separate use case: what if I wanted to run some dfx commands using v0.7.1? What’s the point of storing all the older versions in the dfx cache if I can’t use them?

---

<div class="post-metadata">

**Author:** ![coin\_master](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/coin_master/32/15963_2.png) [@coin\_master](https://forum.dfinity.org/u/coin_master)\
**Post date:** [December 26, 2021, 9:31pm UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928/4 "2021-12-26T21:31:06Z")

</div>

Ummm, have you tried in an empty directory with a dfx.json that has the older version, it’s working for me and generates the old webpack configs as well

---

<div class="post-metadata">

**Author:** ![bioerrorlog](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/bioerrorlog/32/4410_2.png) [@bioerrorlog](https://forum.dfinity.org/u/bioerrorlog)\
**Post date:** [January 20, 2022, 12:53am UTC](https://forum.dfinity.org/t/how-to-generate-a-new-project-using-an-older-dfx-version/9928/5 "2022-01-20T00:53:38Z")

</div>

You can set the dfx version in the environment variable `DFX_VERSION`.

The following command generates a new project with dfx `0.7.1`:  
`DFX_VERSION=0.7.1 dfx new <project_name>`
