Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to run Hello World sample app #473

Closed
mvieiradcu opened this issue Apr 4, 2024 · 6 comments
Closed

Error when trying to run Hello World sample app #473

mvieiradcu opened this issue Apr 4, 2024 · 6 comments
Assignees
Labels
question Further information is requested

Comments

@mvieiradcu
Copy link

Subject of the issue

Error when running Hello World Sample App With Front-End

I am trying to run the sample app Hello World using the command almost init. After executing the smart contract, build and deploy. When running the Front-End application, I am getting the error.

I was trying to follow this video - https://www.youtube.com/watch?v=4-Xy6svMH04&t=609s

node:internal/modules/cjs/loader:1145
  throw err;
  ^

Error: Cannot find module 'set-blocking'
Require stack:
- /Users/mv/.npm/_npx/81881/lib/node_modules/generate/bin/generate.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:1142:15)
    at Module._load (node:internal/modules/cjs/loader:983:27)
    at Module.require (node:internal/modules/cjs/loader:1230:19)
    at require (node:internal/modules/helpers:179:18)
    at process.<anonymous> (/Users/mv/.npm/_npx/81881/lib/node_modules/generate/bin/generate.js:5:3)
    at process.emit (node:events:531:35) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/mv/.npm/_npx/81881/lib/node_modules/generate/bin/generate.js'
  ]
}

Node.js v21.7.1

Client generation failed for /Users/mv/Desktop/algorand-simple-app/algorand-test/projects/algorand-test-contracts/smart_contracts/artifacts/hello_world/application.json.

Your environment

  • Algokit version - algokit, version 2.0.2
  • goal status
    algokit goal node status Last committed block: 3 Time since last block: 2297.6s Sync Time: 0.0s Last consensus protocol: future Next consensus protocol: future Round for next consensus protocol: 4 Next consensus protocol supported: true Last Catchpoint: Genesis ID: dockernet-v1 Genesis hash: YzNbyoDyOjncaJ0uZ6zFAdd8U9SJGe/xZqBgo+0E0Wc=
  • MacOS Sonoma 14.2.1

Steps to reproduce

  1. Algokit init
  2. Selected these options
          ? Which of these options best describes the project you want to build? Smart Contracts & DApp Frontend 🎛️
          ? Which language would you like to use for the smart contract? PyTeal 🔧
          ? Name of project / directory to create the project in: algorand-test
          Starting template copy and render at /Users/marciovieira/Desktop/algorand-simple-app/algorand-test...
          🎤 Name of the template preset to use.
             Starter - for a simpler starting point ideal for prototyping
          🎤 Name of the default smart contract app.
             hello_world
          🎤 Pick language for deployment scripts in the backend?
             Python
          ==== Checking compatibility with the cli ===
  1. Build and Deploy the smart contract using the script on launch.json file
  2. Trying to execute npm run dev command.

Expected behaviour

Actual behaviour

@neilcampbell
Copy link
Contributor

neilcampbell commented Apr 5, 2024

Hi @mvieiradcu
Just wanted to confirm that algokit project bootstrap all ran successfully? It's one the questions asked after the project has been created. If you're not sure, you can re-run it at the root of the workspace.
Are you able to please paste the output of algokit doctor?

@mvieiradcu
Copy link
Author

Hi @neilcampbell ,

It ran algokit project bootstrap all when the project was created successfully, but I ran it again just in case. The error remains after running npm run dev

$algokit doctor    
timestamp: 2024-04-05T06:53:06+00:00
AlgoKit: 2.0.2
AlgoKit Python: 3.12.2 (v3.12.2:6abddd9f6a, Feb  6 2024, 17:02:06) [Clang 13.0.0 (clang-1300.0.29.30)] (location: /Library/Frameworks/Python.framework/Versions/3.12)
OS: macOS-14.2.1-x86_64-i386-64bit
docker: 20.10.22
docker compose: 2.15.1
git: 2.44.0
python: Command not found!
python3: 3.12.2 (location: /Library/Frameworks/Python.framework/Versions/3.12/bin/python3)
pipx: 1.5.0
poetry: 1.8.2
node: 21.7.1
npm: 6.14.11
brew: 4.2.15

@aorumbayev
Copy link
Collaborator

aorumbayev commented Apr 5, 2024

@mvieiradcu you have an outdated version of npm (6.x.x is around 3 years old).

Try updating it with:

npm install -g npm@latest

and then retry algokit project run build from the root of the workspace (repo root) and finally you can do the npm run dev again.

I was able to replicate the exact bug and bumping npm fixed the issue. Will add explicit min npm version to readme to make it clearer. If you hit any further issues related to this bug feel free to reopen the issue otherwise submit a new one 👍

@robdmoore
Copy link
Contributor

@aorumbayev we should potentially have a node-version file and/or engine in package.json if we have a min version we need?

@robdmoore robdmoore added question Further information is requested and removed bug Something isn't working labels Apr 5, 2024
@aorumbayev
Copy link
Collaborator

@robdmoore agree, i think setting the engine might be a better option (will do so on template side as well)

@aorumbayev
Copy link
Collaborator

@aorumbayev aorumbayev self-assigned this Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants