Running NNS-dapp after a fresh git clone
A few notes to share with the team as I had to install locally NNS-dapp on a fresh new laptop.
Note that we are aware that we should improve the documentation and also that my goal was to start the frontend dapp only.
1. So I was not able just run npm run dev to start NNS-dapp locally after having cloned the repo
❯ npm run dev > @firstname.lastname@example.org dev > npm run import-assets && npm run i18n && CANISTER_ID=q3fc5-haaaa-aaaaa-aaahq-cai DFX_NETWORK=testnet npm run build:config && BASE_HREF=/ ROLLUP_WATCH=true npm run build:index && rollup -c -w > @email@example.com import-assets > rm -fr public && cp -R static public > @firstname.lastname@example.org i18n > node scripts/i18n.types.js > @email@example.com build:config > ../config.sh ~/projects/dfinity/nns-dapp ~/projects/dfinity/nns-dapp/frontend ../config.sh: line 98: dfx: command not found
2. So I went on with ./script/setup but it ended in error
❯ ./scripts/setup Assuming user profile script: /Users/daviddalbusco/.zshrc Is it OK to add to this profile? y/N ./build-config.sh: line 4: realpath: command not found ./build-config.sh: line 5: jq: command not found
I found out a solution online: brew install coreutils
3. But then landed on another setup error
Assuming user profile script: /Users/daviddalbusco/.zshrc Is it OK to add to this profile? y/N ./build-config.sh: line 5: jq: command not found
So I tried to download Xcode and its command line tools (7+ gb) thinking it will solve everything (since I needed XCode anyway) but it did not help.
I had to google again and found out that I could brew install jq. Finally, I was able to run setup.
5. Then I was requested to install manually Docker 🤷♂️
6. Then I was requested to agree to install Cargo
7. Finally the setup finishes but with no info on the next steps
8. So I copied the caniset_ids.json as in HACKING.md
9. And then tried to run ./config.sh but got the error
❯ ./config.sh ~/projects/dfinity/nns-dapp ~/projects/dfinity/nns-dapp ./config.sh: line 25: DFX_NETWORK: unbound variable
10. So I ran DFX_NETWORK=small12 ./config.sh but ended in error again
❯ DFX_NETWORK=small12 ./config.sh ~/projects/dfinity/nns-dapp ~/projects/dfinity/nns-dapp ./config.sh: line 98: dfx: command not found
11. So I installed dfx
12. config.sh was successful afterwards and I tweaked my scripts as displayed in HACKING.md
13. Finally, after 1+ hour, I was able to start NNS-dapp frontend