[BUG][SOLVED] how-to-npm verify test.js file



I noticed this during the how-to-npm tutorial:

I followed the steps 1) create a test.js file and 2) change the “scripts” portion of our package.json file in the workspace; but when I tried to run how-to-npm verify I kept catching this error:

@jbdoster/workspace@1.0.0 test /home/ubuntu/workspace
sh: 1: test.js: not found
npm ERR! Test failed. See above for more details.

This is because in the tutorial we are told to replace our “scripts” portion in the package.json file with: (sorry if the indents are incorrect)

“scripts”: {
“test”: “node test.js”

To fix this, simply place a “./” before “test.js” in the block.

So it should look like this: (again, sorry if the indents are incorrect)

“scripts”: {
“test”: “node ./test.js”

This helped the console find the “test.js” file and run the test!

I hope this helped, cheers.