# Dfx deploy locally with a new Dfx identity

**URL:** <https://forum.dfinity.org/t/dfx-deploy-locally-with-a-new-dfx-identity/16470>\
**Category:** Command Line Tools\
**Created:** [November 9, 2022, 8:24pm UTC](https://forum.dfinity.org/t/dfx-deploy-locally-with-a-new-dfx-identity/16470 "2022-11-09T20:24:50Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![Vivienne](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/vivienne/32/29170_2.png) [@Vivienne](https://forum.dfinity.org/u/Vivienne)\
**Post date:** [January 13, 2023, 8:20am UTC](https://forum.dfinity.org/t/dfx-deploy-locally-with-a-new-dfx-identity/16470/24 "2023-01-13T08:20:30Z")

</div>

I assume that this is the problem you guys are running into: [`dfx deploy` halts when running `npm run generate` using a protected identity · Issue #2872 · dfinity/sdk · GitHub](https://github.com/dfinity/sdk/issues/2872)

Looks like my comment above was wrong:

> [@Vivienne](#):
>
> The build step does not access your identity in any way

It should be `The build step SHOULD not access your identity in any way`.

Workaround that I can offer right now, which I figured out because of @nolyoi’s suggestion to remove the prebuild step:

- edit `package.json`
- find field `scripts.generate`
- replace `dfx generate <some canister name>` with `dfx --identity anonymous generate <some canister name>`

This will use the anonymous identity for the build step, (which is available to anyone and not protected by a password) and therefore will not hang the process.

---

_[View the full topic](https://forum.dfinity.org/t/dfx-deploy-locally-with-a-new-dfx-identity/16470)._
