project-serum / anchor : anchor test command is not working

Issue

Cannot find module '/home/rasitha/videos/anchor/examples/tutorial/node_modules/@project-serum/anchor/dist/cjs/index.js'. Please verify that the package.json has a valid "main" entry

I’m getting above error after running anchor test command in basic-1 example in https://github.com/project-serum/anchor. Any help would be apprecicated.

Solution

you have to build the anchor/ts package

do the following

cd anchor/ts

yarn install

yarn build

cd ../examples/tutorials

rm -rf node_modules

yarn install

pls try this

Answered By – Manoj Bandara

Answer Checked By – Gilberto Lyons (AngularFixing Admin)

Leave a Reply

Your email address will not be published.