2
PS C:\Users\PC1\Downloads\portfolio_website-STARTER> npm start

> [email protected] start C:\Users\PC1\Downloads\portfolio_website-STARTER
> node index.js

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

Error: Cannot find module 'C:\Users\PC1\Downloads\portfolio_website-STARTER\index.js'  
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)        
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\PC1\AppData\Roaming\npm-cache\_logs\2021-09-05T22_40_19_833Z-debug.log
PS C:\Users\PC1\Downloads\portfolio_website-STARTER>

The error shown above happens when I try to run npm start to start the virtual host.

I have tried the following:

  1. Updated node.js to the latest version.
  2. Went to package.json under scripts and added "start": "node index.js".
1
  • Do you have this file it complains about: C:\Users\PC1\Downloads\portfolio_website-STARTER\index.js ? Commented Sep 6, 2021 at 0:08

2 Answers 2

1

first, do you install the dependencies? (npm i) Then, exists index.js file in the portfolio_website-STARTER folder?

Sign up to request clarification or add additional context in comments.

2 Comments

Please add further details to expand on your answer, such as working code or documentation citations.
Yes, I didn't install the dependencies, thank you for your help.
0

First make sure your startup file is index.js in your package.json file and make sure you have index.js in your project.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.