0

I have this error:

Last login: Thu Dec 23 12:32:55 on ttys000
juliedecraene@Julies-MBP ~ % node -- version
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/Users/juliedecraene/version'
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v17.3.0

From npm -- version I get:

{
  npm: '8.3.0',
  node: '17.3.0',
  v8: '9.6.180.15-node.12',
  uv: '1.42.0',
  zlib: '1.2.11',
  brotli: '1.0.9',
  ares: '1.18.1',
  modules: '102',
  nghttp2: '1.45.1',
  napi: '8',
  llhttp: '6.0.4',
  openssl: '3.0.1+quic',
  cldr: '40.0',
  icu: '70.1',
  tz: '2021a3',
  unicode: '14.0',
  ngtcp2: '0.1.0-DEV',
  nghttp3: '0.1.0-DEV'
}
halfer
  • 19,824
  • 17
  • 99
  • 186
Julie
  • 11
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 31 '21 at 09:39

1 Answers1

-1

It is hard to figure out what went wrong with just that information but a quick troubleshoot can be checking the following:

  1. Make sure you executed npm install at the root path of your project.
  2. You have a package.json and package-lock.json at the root of your project along with the main file (commonly app.js) These files are created by using the npm install command in your terminal.
  3. You are executing npm commands at the root of your project (where app.js and the package files are).

This question might also be helpful.

Saul Martinez
  • 114
  • 11