Reputation: 43
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:
scripts
and added "start": "node index.js"
.Upvotes: 2
Views: 147
Reputation: 555
First make sure your startup file is index.js in your package.json file and make sure you have index.js in your project.
Upvotes: 0
Reputation: 81
first, do you install the dependencies? (npm i) Then, exists index.js file in the portfolio_website-STARTER folder?
Upvotes: 1