Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

439
Views
Error: Cannot find module 'C:\Users\rodri\nodejs_paypal\src\index.js'

I got these errors on terminal:

PS C:\Users\rodri\nodejs_paypal> npm run dev

nodejs_paypal@1.0.0 dev babel-node src/index.js

node:internal/modules/cjs/loader:936 throw err; ^

Error: Cannot find module 'C:\Users\rodri\nodejs_paypal\src\index.js' 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:77:12) at Object. (C:\Users\rodri\nodejs_paypal\node_modules@babel\node\lib_babel-node.js:176:21)ejs_paypal\node_modules@babel\node\lib_babe/cjs/loader:1105:14)l-node.js:176:21) ternal/modules/cjs/loader:1159:10) at Module._compile (node:internal/modules/loader:981:32)/cjs/loader:1105:14)
odules/cjs/loader:822:12) at Object.Module._extensions..js (node:inMain] (node:internal/modules/run_main:77:12)ternal/modules/cjs/loader:1159:10) 47 { at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } PS C:\Users\rodri\nodejs_paypal>

this is my code:

index.js

import express from 'express'

.babelrc

{
    "presets": [
        "@babel/preset-env"
    ]
}

package.json

{
  "name": "nodejs_paypal",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "babel-node src/index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "axios": "^0.27.2",
    "cors": "^2.8.5",
    "express": "^4.18.1",
    "morgan": "^1.10.0"
  },
  "devDependencies": {
    "@babel/cli": "^7.18.9",
    "@babel/core": "^7.18.9",
    "@babel/node": "^7.18.9",
    "@babel/preset-env": "^7.18.9",
    "babel-install": "2.1.0"
  }
}

My index file is here:

enter image description here

How to solve this issue?

about 4 years ago · Santiago Gelvez
2 answers
Answer question

0

Delete node modules and package-lock.json

run npm install

about 4 years ago · Santiago Gelvez Report

0

I might be wrong but your index.js file seems to be inside the routes folder...

Try to move it "up" into the src folder, or update the path in the "dev" script of your package.json.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!