TypeError: resolver.resolve is not a function

Viewed 1641

When trying to truffle compile smart contracts and deploy them to an RPC testnet, I keep encountering

TypeError: resolver.resolve is not a function at Profiler. (/opt/homebrew/Cellar/truffle/5.3.6/libexec/lib/node_modules/truffle/build/webpack:/packages/compile-common/dist/src/profiler/profiler.js:55:1).

In visual studio code I can't find resolver.resolve anywhere in my code and even cloning projects straight from github it always displays this message when truffle compiling. I have searched everywhere for the resolution and tried debugging myself in the terminal and my current thinking is it's a webpack error but I can't figure out how to solve it. Any help would be greatly appreciated!

1 Answers

I was also in same situation then i find the solution. Follow these steps

  • Remove node_modules directory & package-lock.json (Not package.json)
  • Go to your cli & run npm install command
  • You are done

Hope this solve your problem

Related