Buggy 'Learn TDD With Mocha'

I keep getting this error when I shouldn’t be when I use npm test
Learn TDD with Mocha | Codecademy

$ npm test
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
          cwd = process.cwd();

Error: ENOENT: no such file or directory, uv_cwd
    at Object.resolve (path.js:1142:25)
    at Function.Module._resolveLookupPaths (module.js:391:17)
    at Function.Module._resolveFilename (module.js:461:31)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at /usr/lib/node_modules/npm/bin/npm-cli.js:19:21
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:79:3)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)

The instructions say:

Inside your Calculate object, add a .sum() method that takes one argument.

Run the test suite again in the terminal. You should now get an AssertionError .

Check your work.

"Address the AssertionError in the terminal by making .sum() return the same value as the expected result you defined in your test.

Run the test suite. Your test should pass!

Check your work."

I completed all the tasks and there was never an AssertionError I only got the error in the code I copied and pasted above so I am not able to see the tests… It was working momentarily on step 2 but the following npm tests were all receiving this Error: ENOENT: no such file or directory, uv_cwd error and I tried refreshing the page etc.

1 Like

I keep getting this error on a lot of lessons now… All of the Mocha lessons and Promises… Very annoying i have to refresh the page everytime i want to run node app.js

I ran into the same problem. I finally resorted to checking my code versus the solution code. If there were no appreciable differences, other than spaces or lack of spaces in the code, I just used the solution code to move on. You have to make sure your code is correct, but no point banging your head against the wall because you are missing a space or something trivial like that.