Error while loading create-damp-app on Firefox - npm vulnerabilities not fixing with audit force fix

I am getting an error while running create-daml-app when I run npm. The vulnerabilities are not getting fixed with audit force fix and localhost on firefox opens with an error code displayed

1 Like

Hi @ktreply,

Would you mind sharing the exact steps you took to generate that error, as well as any error message displayed by either Firefox or the terminal?

Note that NPM errors while running npm install may not be fatal errors, despite the scary red used to display them.

Hi @Gary_Verhaegen ,
I see this issue looks very similar to what I have faced and still struggling. So I will share what steps I took to generate the errors. Actually all the steps are taken from Getting started, 6.2 Run the App (DAML Documentation). With the only difference is I named the project “nft”, not “create-daml-app”.
And errors start appear right on the 5th step (at least in my case):

C:\Users\myUserID\nft\ui>npm install

up to date, audited 1870 packages in 10s

91 packages are looking for funding
run npm fund for details

75 vulnerabilities (12 low, 17 moderate, 42 high, 4 critical)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.

No promised:

success Saved lockfile.

After that, I tried 5+ times npm audit fix --force. But it actually never fixes the issues it mentions. Just looping around the same vulnerabilities. Despite of it, I decided to move on to the next step, considering that, as you also point, NPM errors may not be fatal. And here is the result:

Failed to compile
./src/config.ts 134:46
Module parse failed: Unexpected token (134:46)
You may need an appropriate loader to handle this file type.
| // We default to assuming that user management is enabled so we interpret everything that
| // isn’t explicitly “false” as supporting user management.

process.env.REACT_APP_SUPPORTS_USERMANAGEMENT?.toLowerCase() !== “false” ? withUserManagement : noUserManagement;
| export var damlHub = {
| provider: “daml-hub”
This error occurred during the build time and cannot be dismissed.

However it’s not the initial error I got when first faced the issue on this step (unfortunately I couldn’t reproduce that one anymore, but there were more errors for sure). So this, actual one, I’ve been started to observe after workarounding the issue with deploying the app to DAML Hub and installing yarn package.

For the reference: I run it on Windows 11, browser Edge, npm version 9.2.0, DAML SDK version 2.5.0

Can you try following the steps in a new folder without running npm audit fix --force in the middle of it?

I created new project “nft-next” from scratch with the same template, followed all the steps without running

npm audit fix --force

and here is the result for the last 2 steps:

C:\Users\myUserID\nft-next\ui>npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\myUserID\nft-next\ui\node_modules@daml.js\40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open ‘C:\Users\myUserID\nft-next\ui\node_modules@daml.js\40f452260bef3f29dede136108fc08a88d5a5250310281067087da6f0baddff7\package.json’
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\myUserID\AppData\Local\npm-cache_logs\2023-01-13T13_55_39_206Z-debug-0.log

C:\Users\myUserID\nft-next\ui>npm start

nft-next@0.1.0 start
react-scripts --openssl-legacy-provider start

‘react-scripts’ is not recognized as an internal or external command,
operable program or batch file.

Neither a window was opened in my default browser at http://localhost:3000, nor this address is reachable at all when trying to open it manually.

Hi, @Oleg.

I think you are using npm, version 9.2.0. Another Windows user had success downgrading to npm, version 8.6.0. See Error running the UI on the test app - #5 by lordwilliam. It may not help in your case, but it is worth a try?

1 Like

Hi @WallaceKelly
Appreciate your advice, the npm downgrade to 8.6.0 did the trick indeed. And I finally can observe created app’s UI:

1 Like

Uploading: Screenshot 2023-01-12 at 10.19.31.jpg…