Run the Explorer Web UI - ModuleNotFound or Purescript purs Errors

Hello Cardano Community,

I’m try to run the Explorer Web UI docs/how-to/run-explorer-web-ui. I’ve already run the cardano node successfully. Here are the first two errors when I run

./scripts/build-explorer-frontend.sh

ERROR in ./src/index.css
Module build failed:

ERROR in ./src/Main.purs
Module build failed: Error: compilation failed
    at ChildProcess.<anonymous> (/Users/WillsHome/Projects/cardano-sl/explorer/frontend/node_modules/purs-loader/lib/compile.js:53:18)
ERROR in ./src/Explorer/State.purs
Module build failed: Error: purs-loader failed
    at /Users/WillsHome/Projects/cardano-sl/explorer/frontend/node_modules/purs-loader/lib/index.js:303:u5272: 

Then more than 10 of these ModeulNotFound errors, they are cardano source application purescript files(?) that get imported within the following:
./explorer/frontend/src/Explorer/Api/Http.purs
./explorer/frontend/src/Explorer/Routes.purs
./explorer/frontend/src/Explorer/Types/Actions.purs
./explorer/frontend/src/Explorer/Types/State.purs
./explorer/frontend/src/Explorer/Api/Socket.purs

ERROR in [1/87 ModuleNotFound] src/Explorer/Api/Http.purs:22:1

  22  import Pos.Core.Lenses.Types (_EpochIndex, _UnsafeLocalSlotIndex, getEpochIndex, getSlotIndex)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  Module Pos.Core.Lenses.Types was not found.
  Make sure the source file exists, and that it has been provided as an input to the compiler.

[2/87 ModuleNotFound] src/Explorer/Api/Http.purs:23:1

  23  import Pos.Core.Types (EpochIndex(..), LocalSlotIndex)
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Note - I’m pretty sure I have Purescript, because the first time I attempted this I was getting an error like purs executable not found, so I researched and I think I npm installed purescript and added to PATH. To verify:

which purs
/Users/WillsHome/.nvm/versions/node/v7.7.3/bin/purs

purs --version
0.11.7

echo $PATH
/a-bunch-of-stuff:/Users/WillsHome/.nvm/versions/node/v7.7.3/bin/purs

I tried the the Purescript Getting-Started-App app on the Purescript website and it works fine. It showed me a command pulp build and when I try that command anywhere ./explorer/frontend/src I get the same errors I’m posting about! So maybe its this build process that is failing.

I'm using nix In my Ubuntu environment:

$ nix-env -q
electron-1.7.9
nix-1.11.16
nodejs-6.11.5
yarn-1.3.2

Threre is no issue with build-explorer-frontend.sh yet, but also there is no progress for the twenty minutes:

15:57 $ ./scripts/build-explorer-frontend.sh 
yarn install v1.3.2
$ which psc || which purs || npm install purescript@0.11.5
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5

> purescript@0.11.5 postinstall /opt/devel/cardano/cardano-sl/explorer/frontend/node_modules/purescript
> node lib/install.js

At the end I got a similar issue.

Hey I read your Issue on github, try doing:
npm install -g purescript
and see my comments about purescript executable in my post. Might have to update PATH variable too. I’m pretty sure I did all this last week to avoid that error and get to the new errors I’m having.

1 Like

Many thanks for your advice, @devcap!

nix-env -i purescript solved the issue for me. So I closed the github issue yet.

But I can’t start the application yet.
Next trap:

$ yarn start
yarn start v1.0.1
$ npm run server:dev

> cardano-sl-explorer@0.2.0 server:dev /home/palik/Documents/devel/cardano/cardano-sl/explorer/frontend
> npm run clean:output && NODE_ENV=development npm run server:webpack


> cardano-sl-explorer@0.2.0 clean:output /home/palik/Documents/devel/cardano/cardano-sl/explorer/frontend
> rimraf output

sh: rimraf: command not found

npm ERR! Linux 4.9.60
npm ERR! argv "/nix/store/iz92vn135m10jvcxy1f8dch9dgky8gaf-nodejs-6.11.5/bin/node" "/nix/store/iz92vn135m10jvcxy1f8dch9dgky8gaf-nodejs-6.11.5/bin/npm" "run" "clean:output"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! cardano-sl-explorer@0.2.0 clean:output: `rimraf output`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the cardano-sl-explorer@0.2.0 clean:output script 'rimraf output'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cardano-sl-explorer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     rimraf output
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cardano-sl-explorer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cardano-sl-explorer
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/palik/Documents/devel/cardano/cardano-sl/explorer/frontend/npm-debug.log

npm ERR! Linux 4.9.60
npm ERR! argv "/nix/store/iz92vn135m10jvcxy1f8dch9dgky8gaf-nodejs-6.11.5/bin/node" "/home/palik/.nix-profile/bin/npm" "run" "server:dev"
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! cardano-sl-explorer@0.2.0 server:dev: `npm run clean:output && NODE_ENV=development npm run server:webpack`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the cardano-sl-explorer@0.2.0 server:dev script 'npm run clean:output && NODE_ENV=development npm run server:webpack'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the cardano-sl-explorer package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run clean:output && NODE_ENV=development npm run server:webpack
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs cardano-sl-explorer
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls cardano-sl-explorer
npm ERR! There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! Please include the following file with any support request:
npm ERR!     /home/palik/Documents/devel/cardano/cardano-sl/explorer/frontend/npm-debug.log
error Command failed with exit code 1.

hmm rimraf, I may have tried installing that too at one point, I forget
which docs/how-to it was for. See if its on ‘npm’ for install.