0

I am on windows 10, using vscode. Basically finished the petshop tutorial with no issues or problems using truffle.

when I enter the command npm run dev it fails as shown below.

PS Y:\code\petshop> npm run dev

> pet-shop@1.0.0 dev
> lite-server

internal/modules/cjs/loader.js:316
      throw err;
      ^

Error: Cannot find module 'Y:\code\petshop\node_modules\immutable\dist\immutable'. Please verify that the package.json has a valid "main" entry
    at tryPackage (internal/modules/cjs/loader.js:308:19)
    at Function.Module._findPath (internal/modules/cjs/loader.js:521:18)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:872:27)
    at Function.Module._load (internal/modules/cjs/loader.js:730:27)
    at Module.require (internal/modules/cjs/loader.js:957:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (Y:\code\petshop\node_modules\browser-sync\dist\hooks.js:3:17)       
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32) {
  code: 'MODULE_NOT_FOUND',
  path: 'Y:\\code\\petshop\\node_modules\\immutable\\package.json',
  requestPath: 'immutable'
}

Not sure where to go from here, nothing works. This type of error is a bit beyond me. Any and all help is greatly appreciated.

EDIT: changed screenshot to code snippet. And I realized the problem is that the 'immutable' path is non-existent in my node_modules. Still not sure how to address this. tried a cheeky npm install immutable to no avail....

  • Also, do you have a `Y:` drive that contains the indicated file at the indicated location? I don't have anything close to a `Y:` drive on my machine, which has three hard disks and an optical drive. – Ken White Jun 09 '21 at 01:46
  • @KenWhite, i setup my storage partitions as X,Y, and Z. – phillip shields Jun 09 '21 at 01:48
  • And is the indicated file actually located in that exact path, with the exact same name? (The second image you posted also does not apply - it refers to the Truffle cmd file not being found, which is not the error you're getting.) – Ken White Jun 09 '21 at 01:50
  • so the `node_modules/immutable/` dir contains an empty `contr` dir, license file, package.json, and a README.md . no other files – phillip shields Jun 09 '21 at 01:57
  • And did you *Please verify that the package.json has a valid "main" entry*? (I'm just asking questions that you should be able to ask yourself by reading the error message, BTW.) – Ken White Jun 09 '21 at 02:11
  • tried `npm uninstall immutable` and then reinstalling it, no luck. – phillip shields Jun 09 '21 at 02:16
  • its looking for `node_modules/immutable/dist/immutable`, which doesnt exist, hence my prior attempt at uninstalling and reinstalling the node module. gonna try everything in wsl2 and see if I get the same error. – phillip shields Jun 09 '21 at 02:44

0 Answers0