Dependency issue when installing the js sdk

I installed the js sdk for client using npm i --save moralis, but Iโ€™m getting the following error:

The required JS dependency "json-rpc-engine/src/createAsyncMiddleware" is not available, it was required by "node_modules/eth-json-rpc-middleware/block-cache.js".


	node_modules/moralis/index.js
	node_modules/moralis/lib/browser/Parse.js
	node_modules/moralis/lib/browser/decode.js
	node_modules/moralis/lib/browser/ParseACL.js
	node_modules/moralis/lib/browser/ParseUser.js
	node_modules/moralis/lib/browser/MoralisWeb3.js
	node_modules/moralis/lib/browser/MoralisWalletConnectProvider.js
	node_modules/@walletconnect/web3-provider/dist/esm/index.js
	node_modules/web3-provider-engine/subproviders/cache.js
	node_modules/eth-json-rpc-middleware/block-cache.js

I tried removing node_modules and reinstalling using npm i. I also tried npm i --save json-rpc-engine but that still gives the error. I tried npm i --save json-rpc-engine/src/createAsyncMiddleware, but that npm package doesnโ€™t exist. How to fix this?

Hi,
I just executed:

npm init --yes
npm install --save moralis

and I didnโ€™t have any errors

1 Like