Error running the UI on the test app

Just trying to get the create-daml-app UI running.

After installing SDK and running daml start I try to import the nom elements required by running rpm install but it tells me there is a missing file.

create-daml-app/ui/node_modules/@daml.js/40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7/package.json

npm ERR! enoent ENOENT: no such file or directory, open

2 Likes

Welcome @jacal18 to the Forum.

I’ll assume that you are using a MacOS or Linux as your system.

For this create-daml-app, you will need two terminals:

First_Terminal:

$ daml new --template create-daml-app create-daml-app
$ cd create-daml-app/
$ daml start

Second_Terminal:

$ cd create-daml-app/ui
$ npm install
$ npm start

The particular error, ENOENT means that npm has failed to open a file or directory that’s required for executing the command, so either you are not in the correct directory which is create-daml-dar/ui or you are in the correct directory but the package.json file is missing.

Follow those steps above, if it works great. If not, then just rm -rf create-daml-app and go again.

Let me know if this helps.

The most likely issue for that error message is that you did not run daml start (or it somehow failed). daml start is a shortcut to run a number of separate commands as one; in this case, the two crucial steps are:

  • daml build to compile the Daml code into a DAR file.
  • daml codegen js to parse the DAR file and generate JS code based on it. I suspect this is the missing code in your case.

Hi, I’ve followed those steps, however it fails when I try to run npm install.

EDIT - The problem in my machine seems to be related to npm version. I’ve downgraded from 9.2.0 to 8.6.0 and now it is working. (BTW, I’m using node v18.12.1)

3 Likes

Thank very much @jvelasco.intellecteu your answer solved my problem.
I downgraded to npm version 8.19.3 by running “npm install -g npm@8.19.3” without the quotation marks in the terminal.

1 Like

Thank you so much for this explanation, it worked for me!

1 Like