So I'm trying to run the npm start on a react project I made in command line so that I can run the browser sync and see my progress as I work on it.
However, I keep getting this result whenever I try to run it.
module.js:538
throw err;
^
Error: Cannot find module '/Users/Sam/Library/Mobile Documents/com~apple~CloudDocs/Work/BookStore/Home attempts/Routing/2-react-router/lib/server.js'
at Function.Module._resolveFilename (module.js:536:15)
at Function.Module._load (module.js:466:25)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tutorials#0.0.0 start: `node lib/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-tutorials#0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Sam/.npm/_logs/2017-11-30T20_10_07_869Z-debug.log
I'm not sure what's going on as I'm not an expert on react/node/npm, rather a reluctant amateur.
Can anyone help?
When you execute npm start, a command node lib/server.js is called. Command is defined in package.json
"scripts": {
"start": "node lib/server.js"
}
Looking from the error post it looks that server.js file is missing in lib folder.
Related
> # dev C:\Users\Mustafa\Desktop\React&Next\insta-2.0
> next dev
'Next\insta-2.0\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'C:\Users\Mustafa\Desktop\next\dist\bin\next'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746: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! # dev: `next dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Mustafa\AppData\Roaming\npm-cache\_logs\2021-10-13T15_27_45_466Z-debug.log
I am using npm run dev and it gives me this error and I don't understand what this error is about if any of you could help me solve this I would really appreciate it
Go to the root directory of Your next project and run this commands in terminal:
npm install next react react-dom
after
npm run dev
Or if You are using VSCode open Your next project in Visual Studio Code, run the integrated terminal (Ctrl+`) and enter the above commands.
It's should works now ;-)
Error: Cannot find module 'This is the Folder path \bin\webpack.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! # dev: `webpack serve --config ./bundler/webpack.dev.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\21697\AppData\Roaming\npm-cache\_logs\2021-09-20T20_54_58_070Z-debug.log
PS C:This is the Folder path>
PS: I did delete both the package-lock & node_modules and reinstalled npm using npm install
but the problem still exists, I also tried reinstalling node js, same thing
Error: Cannot find module 'This is the Folder path \bin\webpack.js'
It's looking for a module with name/path 'This is the Folder path \bin\webpack.js'. That doesn't look like a valid module name/path.
Looks like you added some debug text somewhere you shouldn't have.
Hard to come up with other explanations since you did not post any of the code.
I finally solved it by reinstalling both node js & npm and instlalling chokidar 3 using the command npm i chokidar#3.0.0 it turns out that the previous version does not support node js 14+
i am new to the framework and was just going through a tutorial and encountered by an error after pressing create app in the local host
Generating package.json
✔ Creating required folders structure
✔ Installing NPM Dependencies
✔ Installing NPM Dev Dependencies
Executing NPM Scripts
this happens its stuck at executing NPM scripts waited a whole 3 hours still executing
The start npm command shows the following:-
> whatchat#1.0.0 start C:\Users\piyush\whatchat
> npm run dev
> whatchat#1.0.0 dev C:\Users\piyush\whatchat
> cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\piyush\whatchat\build\webpack.config.js'
Require stack:
- C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at WEBPACK_OPTIONS (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> (C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_671Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_828Z-debug.log
i searched lot on Google and discord coding help servers but could not fix this please help me out
you probably didn't install cordova before try:
npm install -g cordova
I've been battling this issue all day and still cannot figure out what I am missing. I've always created my projects under the Documents directory on my computer but I've started getting the following error when trying to start a project after using create-react-app.
my-app#0.1.0 start C:\Users\{user}\Documents\B&R Fun\nginx_test_deploy\my-app
react-scripts start
'R' is not recognized as an internal or external command,
operable program or batch file.
internal/modules/cjs/loader.js:985
throw err;
^
Error: Cannot find module 'C:\Users\{user}\Documents\react-scripts\bin\react-scripts.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\{user}\AppData\Roaming\npm-cache\_logs\2020-03-30T21_02_14_553Z-debug.log
Interestingly, running the exact same commands on my desktop creates an app without errors. Is there some configuration I'm missing that could impact apps created under the 'Documents' folder?
You should try to clear and re-install node_modules. You can do this by running the following command.
rm -rf node_modules package-lock.json && npm install && npm start
Also, upgrade to a later version of node and npm.
Try to rename B&R Fun folder to avoid ampersand there. It seems that & breaks everything. See this issue
I want to host my website using node.js.
After npm install express --save, and adding package-lock.json & package.json & Procfile & node_module & .env.
I have tried this below, but not worked.
rm -rf node_modules
npm install
What other approaches should I do? The following is my error.
> portfolio-website#1.0.0 start /Users/John/Project/portfolio-website
> node server
module.js:557
throw err;
^
Error: Cannot find module '/Users/John/Project/portfolio-website/server'
at Function.Module._resolveFilename (module.js:555:15)
at Function.Module._load (module.js:482:25)
at Function.Module.runMain (module.js:701:10)
at startup (bootstrap_node.js:190:16)
at bootstrap_node.js:662:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portfolio-website#1.0.0 start: `node server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio-website#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/John/.npm/_logs/2019-01-21T00_09_21_588Z-debug.log
server folder includes server.js.
First of all, why cannot module be found? The order of path is correct.
If the server.js file is inside server folder, then you should run node server/server.js