My nodejs project stopped working


#1

Hi! My project was running fine but now i’m getting this error:

Error: Promise rejected with value: { code: 'E404',

  uri: 'https://registry.npmjs.org/har-validator/-/har-validator-5.1.2.tgz',

  response: 

   { body: 

      { _readableState: [Object],

        readable: true,

        _events: {},

        _eventsCount: 1,

        _writableState: [Object],

        writable: false,

        allowHalfOpen: true,

        _transformState: [Object] },

     size: 0,

     timeout: 0,

     url: 'https://registry.npmjs.org/har-validator/-/har-validator-5.1.2.tgz',

     status: 404,

     statusText: 'Not Found',

     headers: {} },

  attempts: 3,

  resource: 'https://registry.npmjs.org/har-validator/-/har-validator-5.1.2.tgz',

  message: '404 Not Found: https://registry.npmjs.org/har-validator/-/har-validator-5.1.2.tgz' }

    at /opt/nvm/versions/node/v10.14.1/lib/node_modules/pnpm/lib/node_modules/loud-rejection/index.js:27:12

    at Array.forEach (<anonymous>)

    at EventEmitter.<anonymous> (/opt/nvm/versions/node/v10.14.1/lib/node_modules/pnpm/lib/node_modules/loud-rejection/index.js:23:24)

    at emitTwo (events.js:126:13)

    at EventEmitter.emit (events.js:214:7)

    at emit (/opt/nvm/versions/node/v10.14.1/lib/node_modules/pnpm/lib/node_modules/signal-exit/index.js:77:11)

    at processEmit [as emit] (/opt/nvm/versions/node/v10.14.1/lib/node_modules/pnpm/lib/node_modules/signal-exit/index.js:150:5)

    at process.exit (internal/process.js:146:15)

    at Timeout.setTimeout [as _onTimeout] (/opt/nvm/versions/node/v10.14.1/lib/node_modules/pnpm/lib/err.js:10:30)

    at ontimeout (timers.js:498:11)

module.js:550

    throw err;

    ^
Error: Cannot find module 'discord.js'

    at Function.Module._resolveFilename (module.js:548:15)

    at Function.Module._load (module.js:475:25)

    at Module.require (module.js:597:17)

    at require (internal/module.js:11:18)

at Object.<anonymous> (/app/server.js:1:79)

    at Module._compile (module.js:653:30)

    at Object.Module._extensions..js (module.js:664:10)

    at Module.load (module.js:566:32)

    at tryModuleLoad (module.js:506:12)

    at Function.Module._load (module.js:498:3)

I’ve tried rewinding to no avail. My project ran into a wall for no reason, and it was running fine yesterday


MOD EDIT: code formatting


#2

Try running enable-pnpm in console?


#3

Hey @Carcraftz it looks like the version of har-validator that’s being required has been removed from npm.

Depending on what’s in your dependencies it’s possible that something in your dependency tree is looking for that specific version. If that “Add package” button visible in your package.json file shows that there are updates available, clicking it to install update packages might help.


#4

I tried this, but it didn’t work :confused:


#5

This didn’t work either :frowning_face:


#6

Ok, next thing to try is to check your shrinkwrap.yaml file. Can you execute grep ‘5.1.2’ shrinkwrap.yaml in your project’s console and if it returns a result then run

rm shrinkwrap.yaml
enable-pnpm

In your console and let us know how that goes?


#7

Why are you deleting shrinkwrap?


#8

shrinkwrap.yaml is like package.lock, and contains static references to specific versions of packages. If it references a version of a package that’s been removed from npm, that dependency will return a 404. A simple way to explain updating it is just to delete it and have pnpm create a new one with updated references.