I am reading the tutorial on Ethereum Pet Shop -- Your First DApp, everything seems ok until I test with truffle test
with below error:
Error: Cannot find module 'fs-extra'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.call (/Users/.npm-global/lib/node_modules/truffle/node_modules/@truffle/debugger/dist/external "fs-extra":1:18)
at r (/Users/.npm-global/lib/node_modules/truffle/node_modules/@truffle/debugger/dist/webpack/bootstrap:19:22)
[...]
Truffle v5.2.4 (core: 5.2.4)
Node v10.16.0
I have tried some suggestions as in Module is extraneous npm, but the Error: Cannot find module 'fs-extra'
insists.
You need to add it to your package.json
and install the package.
Either run
npm install --save fs-extra
The --save
option will add it to the package.json
for you.
Or add it manually to the package.json
section dependencies
"dependencies": {
"fs-extra": "^9.1.0"
}
and then install it
npm install
Version 9.1.0 is the current version according to npmjs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With