# Invalid proposal key during account creation on flow-js-testing

**URL:** <https://forum.flow.com/t/invalid-proposal-key-during-account-creation-on-flow-js-testing/2222>\
**Category:** Flow JavaScript SDK\
**Tags:** flow-sdk-js\
**Created:** [July 21, 2021, 10:12pm UTC](https://forum.flow.com/t/invalid-proposal-key-during-account-creation-on-flow-js-testing/2222 "2021-07-21T22:12:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xie](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@xie](https://forum.flow.com/u/xie)\
**Post date:** [July 21, 2021, 10:12pm UTC](https://forum.flow.com/t/invalid-proposal-key-during-account-creation-on-flow-js-testing/2222/1 "2021-07-21T22:12:42Z")

</div>

I am trying to follow along the API for creating javascript tests for my contracts and I am running to an issue at the account creation example and any other commands that I try to run. The error that I see is something like this:

`ERR [bb17b4] [Error Code: 1006] invalid proposal key: public key 0 on account f8d6e0586b0a20c7 does not have a valid signature: [Error Code: 1009] invalid envelope key: public key 0 on account f8d6e0586b0a20c7 does not have a valid signature: signature is not valid`

So far my files are as follows:

Test I am trying to run

```auto
import path from "path";
import { init, getAccountAddress } from "flow-js-testing";

const basePath = path.resolve(__dirname, "../cadence");

describe("Accounts", () => {
  // Instantiate emulator and path to Cadence files
  beforeEach(async (done) => {
    const port = 8080;
    init(basePath, port);
    done();
  });
  
  test("Create Accounts", async () => {
    const Alice = await getAccountAddress("Alice");

    console.log("Account were created with following addresses:\n", {
      Alice,
    });
    expect(0).toBe(0);
  });
});

```

flow.json

```auto
{
	"emulators": {
		"default": {
			"port": 3569,
			"serviceAccount": "emulator-account"
		}
	},
	"contracts": {},
	"networks": {
		"emulator": "127.0.0.1:3569",
		"mainnet": "access.mainnet.nodes.onflow.org:9000",
		"testnet": "access.devnet.nodes.onflow.org:9000"
	},
	"accounts": {
		"emulator-account": {
			"address": "f8d6e0586b0a20c7",
			"key": "858cb926afafe6a681c130b1b471a9b67288dd10bd81a0c976f09d478c06ef7b"
		}
	},
	"deployments": {}
}

```

---

<div class="post-metadata">

**Author:** ![xie](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@xie](https://forum.flow.com/u/xie)\
**Post date:** [July 21, 2021, 10:15pm UTC](https://forum.flow.com/t/invalid-proposal-key-during-account-creation-on-flow-js-testing/2222/2 "2021-07-21T22:15:02Z")

</div>

MaxStarka found the solution to my issue!

my `flow version` was returning `Version: v0.22.0`

and my pack.json had `"flow-js-testing": "^0.1.12"` which required the latest CLI (`Version: v0.25.1`)

After updating my flow-cli by running `brew install flow-cli` and deleting my `flow.json` and getting a clean one from `flow init` I was able to run the test successfully and see the address of the new account printed!

---

<div class="post-metadata">

**Author:** ![kimcodeashian](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/kimcodeashian/32/498_2.png) [@kimcodeashian](https://forum.flow.com/u/kimcodeashian)\
**Post date:** [July 23, 2021, 3:39am UTC](https://forum.flow.com/t/invalid-proposal-key-during-account-creation-on-flow-js-testing/2222/3 "2021-07-23T03:39:55Z")

</div>

MaxStarka is great! Glad you were able to get that resolved - happy building @xie!
