Did you start from a template, or are you building your UI from scratch? If you started from create-daml-app
, i.e. using a command along the lines of
daml new --template-name=create-daml-app my-project
the generated README should tell you the NPM steps:
cd ui
npm install
npm run-script build
This requires a fairly recent version of NPM, though I don’t remember the specific version number right now.
For reference, here is the package.json
generated by the above command with the latest Daml SDK version (1.15.0):
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"@daml.js/my-project": "file:daml.js/my-project-0.1.0",
"@daml/ledger": "1.15.0",
"@daml/react": "1.15.0",
"@daml/types": "1.15.0",
"jwt-simple": "^0.5.6",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"dotenv": "^8.2.0",
"semantic-ui-css": "^2.4.1",
"semantic-ui-react": "^0.88.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --testURL='http://localhost:7575'",
"eject": "react-scripts eject",
"lint": "eslint --ext .js,.jsx,.ts,.tsx src/"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@types/jwt-simple": "^0.5.33",
"@types/react": "^16.9.16",
"@types/react-dom": "^16.9.4",
"@types/dotenv": "^8.2.0",
"http-proxy-middleware": "^1.0.4",
"react-scripts": "^4.0.3",
"typescript": "~3.8.3"
}
}
Based on your error messages, it looks like you may be missing the devDependencies
related to React types.
Can you confirm whether you see this error message on a brand new project? If not, does comparing your package.json
to the one above offer any insight?