Test file not running

New user, running on Linux system. files downloaded successfully for intro exercise on local machine, but when I run the ‘hello-world’ test with the command npm test I get the following: sh: 1: jest: not found

Which language are you working with?

Did you do npm install first? Read the HELP.md file.

That sounds like you need to install the jest package. Jest appears to be a JavaScript test framework. The JS test docs mention Jest but don’t explicitly call out the need to install it; there may be room for calling that out in the docs somewhere.

working with javascript.

npm is installed and the command-line interface seems to be working fine otherwise. I’m even able to successfully submit file for review.

so it appears I didn’t have jest installed, but after installation I now get Error: Cannot find module @exercism/babel-preset-javascript`

Turns out Hello World doesn’t have this one: javascript/exercises/practice/hello-world/.docs at main · exercism/javascript · GitHub

@grenudo Please try these instructions. Is the result the same?

No exercise has this file. It gets built from files in exercises/shared/.docsPresentation | Exercism's Docs

1 Like

first, thanks everyone for your recommendations.

@MatthijsBlom After further reading of instructions, I exported my function as per -Making Your First JavaScript 2015 Module - as well as installing the jest package. I seemed to be making some progress, except now I get SyntaxError pointing to the ‘run.js’ file within the node_modules. At this point I feel I made this way more complicated then it should’ve been.

The only step you should need to take is

npm install

…once per exercise, inside the directory that has package.json.

You don’t need to change the provided files or install something explicity, other than node.

A few things to check:

  • Does node -v in the terminal yield 16.x.y or 18.x.y? If it starts with a lower number or an odd number, please upgrade your node to a newer even number. See Node.js.
  • Did you download the exercise to your machine using our CLI? If no, what did you use?
  • If the above didn’t yield something working, can you upload the package.json and generated package-lock.json here? I can then compare it to what it generated on my machine. This allows us to figure out if there is something weird going on with package resolution.