# Package.json are not generated when running daml codegen

**URL:** <https://forum.canton.network/t/package-json-are-not-generated-when-running-daml-codegen/2893>\
**Category:** App Development\
**Tags:** daml\
**Created:** [July 27, 2021, 3:36am UTC](https://forum.canton.network/t/package-json-are-not-generated-when-running-daml-codegen/2893 "2021-07-27T03:36:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ariscatan](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ariscatan/32/2249_2.png) [@ariscatan](https://forum.canton.network/u/ariscatan)\
**Post date:** [July 27, 2021, 3:36am UTC](https://forum.canton.network/t/package-json-are-not-generated-when-running-daml-codegen/2893/1 "2021-07-27T03:36:18Z")

</div>

Hi guys,  
I get this error when running npm install after running make build, here is my make file content:

```haskell
build:
	daml build
	daml codegen js -o ui .daml/dist/*.dar
	daml damlc visual .daml/dist/*.dar --dot private-nft.dot
	cd ui && npm install
	cd ui && npm run build

```

I noticed that the package.json are not generated.

 ![image](https://canada1.discourse-cdn.com/flex028/uploads/daml/original/2X/1/18f81c114aaa47fd897f00cfcea019609fb87b51.png)

Is there anything need I to modify on my code? Thanks

Best regards,

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [July 27, 2021, 7:25am UTC](https://forum.canton.network/t/package-json-are-not-generated-when-running-daml-codegen/2893/2 "2021-07-27T07:25:35Z")

</div>

The codegen will generate a set of packages each with their own package.json. E.g., for `create-daml-app` the directory structure looks something like this (simplified)

```haskell
daml.js
daml.js/cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7
daml.js/cc348d369011362a5190fe96dd1f0dfbc697fdfd10e382b9e9666f0da05961b7/package.json
daml.js/733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a
daml.js/733e38d36a2759688a4b2c4cec69d48e7b55ecc8dedc8067b815926c917a182a/package.json
daml.js/76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f
daml.js/76bf0fd12bd945762a01f8fc5bbcdfa4d0ff20f8762af490f8f41d6237c6524f/package.json
daml.js/7f251391d4950ccf51b9983ebd2ffe1823d49ce92b536cc4ea96c18b38e2ae28
daml.js/7f251391d4950ccf51b9983ebd2ffe1823d49ce92b536cc4ea96c18b38e2ae28/package.json
daml.js/create-daml-app-0.1.0
daml.js/create-daml-app-0.1.0/package.json

```

The codegen will _not_ generate a top-level package.json for your own project. You have to define that yourself and reference the generated packages in the `dependencies`. You can see the one used for `create-daml-app` here [daml/package.json.template at 2bdcb7b69fa6cb07b14e1f7a99391db822d8766b · digital-asset/daml · GitHub](https://github.com/digital-asset/daml/blob/2bdcb7b69fa6cb07b14e1f7a99391db822d8766b/templates/create-daml-app/ui/package.json.template#L6) (replace `PROJECT_NAME` by your own project name and adjust file paths as needed).

---

<div class="post-metadata">

**Author:** ![ariscatan](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/ariscatan/32/2249_2.png) [@ariscatan](https://forum.canton.network/u/ariscatan)\
**Post date:** [July 27, 2021, 4:12pm UTC](https://forum.canton.network/t/package-json-are-not-generated-when-running-daml-codegen/2893/3 "2021-07-27T16:12:43Z")

</div>

Hi @cocreature  
Thank you for replying. Yes I uderstand now, my test project was created without the create-daml-app as template which result into no package.json created on ui folder.

Solution was to create a package.json under folder where you output the codegen js. Another was use the create-daml-app as template and it was ready for you to use.

Awesome!

Thank you
