getting errors with webpack mern full stack
I'm very new on this MERN web app thing, and following several tutorials on youtube, ended up on this particular tutorial, this guy uses webpack, and runs the command line from the package.json script, did pretty much the same steps, but in my case, i get a ton of erros and warnings, not sure what i did wrong, this is the log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'webpack' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prewebpack', 'webpack', 'postwebpack' ]
5 info lifecycle mern-stack-tasks@1.0.0~prewebpack: mern-stack-tasks@1.0.0
6 info lifecycle mern-stack-tasks@1.0.0~webpack: mern-stack-tasks@1.0.0
7 verbose lifecycle mern-stack-tasks@1.0.0~webpack: unsafe-perm in lifecycle true
8 verbose lifecycle mern-stack-tasks@1.0.0~webpack: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:UsersAdminDesktopMERN-STACK-TASKSnode_modules.bin;C:Program Files (x86)Python37-32Scripts;C:Program Files (x86)Python37-32;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesMicrosoft VS Codebin;C:Program Filesnodejs;C:UsersAdminAppDataLocalMicrosoftWindowsApps;C:UsersAdminAppDataRoamingnpm
9 verbose lifecycle mern-stack-tasks@1.0.0~webpack: CWD: C:UsersAdminDesktopMERN-STACK-TASKS
10 silly lifecycle mern-stack-tasks@1.0.0~webpack: Args: [ '/d /s /c', 'webpack --mode=development' ]
11 silly lifecycle mern-stack-tasks@1.0.0~webpack: Returned: code: 2 signal: null
12 info lifecycle mern-stack-tasks@1.0.0~webpack: Failed to exec webpack script
13 verbose stack Error: mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid mern-stack-tasks@1.0.0
15 verbose cwd C:UsersAdminDesktopMERN-STACK-TASKS
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "webpack"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
22 error Exit status 2
23 error Failed at the mern-stack-tasks@1.0.0 webpack script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
and these are the issues
C:UsersAdminDesktopMERN-STACK-TASKS>npm run webpack
> mern-stack-tasks@1.0.0 webpack C:UsersAdminDesktopMERN-STACK-TASKS
> webpack --mode=development
Hash: e7f652b71ffb968075a8
Version: webpack 4.25.1
Time: 3188ms
Built at: 2018-11-13 16:12:51
Asset Size Chunks Chunk Names
main.js 2.82 MiB main [emitted] main
Entrypoint main = main.js
[0] ./streams (ignored) 15 bytes {main} [built]
[1] ./extend-node (ignored) 15 bytes {main} [built]
[2] util (ignored) 15 bytes {main} [built]
[3] util (ignored) 15 bytes {main} [built]
[4] http (ignored) 15 bytes {main} [built]
[5] buffer (ignored) 15 bytes {main} [optional] [built]
[6] crypto (ignored) 15 bytes {main} [optional] [built]
[./node_modules/express/lib sync recursive] ./node_modules/express/lib sync 160 bytes {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
[./src/database.js] 302 bytes {main} [built]
[./src/index.js] 1.14 KiB {main} [built]
[./src/models/task.js] 258 bytes {main} [built]
[./src/routes/task.routes.js] 1.13 KiB {main} [built]
+ 400 hidden modules
WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesdestroy'
@ ./node_modules/destroy/index.js 14:17-30
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesetag'
@ ./node_modules/etag/index.js 22:12-25
@ ./node_modules/express/lib/utils.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/view.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/view.js 18:9-22
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/mime/mime.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesmime'
@ ./node_modules/mime/mime.js 2:9-22
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/send/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulessend'
@ ./node_modules/send/index.js 23:9-22
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/request.js 18:11-25
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mern-stack-tasks@1.0.0 webpack 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:UsersAdminAppDataRoamingnpm-cache_logs2018-11-13T19_12_51_743Z-debug.log
C:UsersAdminDesktopMERN-STACK-TASKS>npm run dev
> mern-stack-tasks@1.0.0 dev C:UsersAdminDesktopMERN-STACK-TASKS
> nodemon src/index.js
by the way this thing didn't worked, i checked on github with guys having a similar issue, but it looks like this is not the case for me
node: {
fs: 'empty'
}
thanks in advance, and sorry for this convoluted post
webpack mern
add a comment |
I'm very new on this MERN web app thing, and following several tutorials on youtube, ended up on this particular tutorial, this guy uses webpack, and runs the command line from the package.json script, did pretty much the same steps, but in my case, i get a ton of erros and warnings, not sure what i did wrong, this is the log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'webpack' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prewebpack', 'webpack', 'postwebpack' ]
5 info lifecycle mern-stack-tasks@1.0.0~prewebpack: mern-stack-tasks@1.0.0
6 info lifecycle mern-stack-tasks@1.0.0~webpack: mern-stack-tasks@1.0.0
7 verbose lifecycle mern-stack-tasks@1.0.0~webpack: unsafe-perm in lifecycle true
8 verbose lifecycle mern-stack-tasks@1.0.0~webpack: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:UsersAdminDesktopMERN-STACK-TASKSnode_modules.bin;C:Program Files (x86)Python37-32Scripts;C:Program Files (x86)Python37-32;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesMicrosoft VS Codebin;C:Program Filesnodejs;C:UsersAdminAppDataLocalMicrosoftWindowsApps;C:UsersAdminAppDataRoamingnpm
9 verbose lifecycle mern-stack-tasks@1.0.0~webpack: CWD: C:UsersAdminDesktopMERN-STACK-TASKS
10 silly lifecycle mern-stack-tasks@1.0.0~webpack: Args: [ '/d /s /c', 'webpack --mode=development' ]
11 silly lifecycle mern-stack-tasks@1.0.0~webpack: Returned: code: 2 signal: null
12 info lifecycle mern-stack-tasks@1.0.0~webpack: Failed to exec webpack script
13 verbose stack Error: mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid mern-stack-tasks@1.0.0
15 verbose cwd C:UsersAdminDesktopMERN-STACK-TASKS
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "webpack"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
22 error Exit status 2
23 error Failed at the mern-stack-tasks@1.0.0 webpack script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
and these are the issues
C:UsersAdminDesktopMERN-STACK-TASKS>npm run webpack
> mern-stack-tasks@1.0.0 webpack C:UsersAdminDesktopMERN-STACK-TASKS
> webpack --mode=development
Hash: e7f652b71ffb968075a8
Version: webpack 4.25.1
Time: 3188ms
Built at: 2018-11-13 16:12:51
Asset Size Chunks Chunk Names
main.js 2.82 MiB main [emitted] main
Entrypoint main = main.js
[0] ./streams (ignored) 15 bytes {main} [built]
[1] ./extend-node (ignored) 15 bytes {main} [built]
[2] util (ignored) 15 bytes {main} [built]
[3] util (ignored) 15 bytes {main} [built]
[4] http (ignored) 15 bytes {main} [built]
[5] buffer (ignored) 15 bytes {main} [optional] [built]
[6] crypto (ignored) 15 bytes {main} [optional] [built]
[./node_modules/express/lib sync recursive] ./node_modules/express/lib sync 160 bytes {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
[./src/database.js] 302 bytes {main} [built]
[./src/index.js] 1.14 KiB {main} [built]
[./src/models/task.js] 258 bytes {main} [built]
[./src/routes/task.routes.js] 1.13 KiB {main} [built]
+ 400 hidden modules
WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesdestroy'
@ ./node_modules/destroy/index.js 14:17-30
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesetag'
@ ./node_modules/etag/index.js 22:12-25
@ ./node_modules/express/lib/utils.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/view.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/view.js 18:9-22
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/mime/mime.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesmime'
@ ./node_modules/mime/mime.js 2:9-22
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/send/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulessend'
@ ./node_modules/send/index.js 23:9-22
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/request.js 18:11-25
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mern-stack-tasks@1.0.0 webpack 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:UsersAdminAppDataRoamingnpm-cache_logs2018-11-13T19_12_51_743Z-debug.log
C:UsersAdminDesktopMERN-STACK-TASKS>npm run dev
> mern-stack-tasks@1.0.0 dev C:UsersAdminDesktopMERN-STACK-TASKS
> nodemon src/index.js
by the way this thing didn't worked, i checked on github with guys having a similar issue, but it looks like this is not the case for me
node: {
fs: 'empty'
}
thanks in advance, and sorry for this convoluted post
webpack mern
add a comment |
I'm very new on this MERN web app thing, and following several tutorials on youtube, ended up on this particular tutorial, this guy uses webpack, and runs the command line from the package.json script, did pretty much the same steps, but in my case, i get a ton of erros and warnings, not sure what i did wrong, this is the log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'webpack' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prewebpack', 'webpack', 'postwebpack' ]
5 info lifecycle mern-stack-tasks@1.0.0~prewebpack: mern-stack-tasks@1.0.0
6 info lifecycle mern-stack-tasks@1.0.0~webpack: mern-stack-tasks@1.0.0
7 verbose lifecycle mern-stack-tasks@1.0.0~webpack: unsafe-perm in lifecycle true
8 verbose lifecycle mern-stack-tasks@1.0.0~webpack: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:UsersAdminDesktopMERN-STACK-TASKSnode_modules.bin;C:Program Files (x86)Python37-32Scripts;C:Program Files (x86)Python37-32;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesMicrosoft VS Codebin;C:Program Filesnodejs;C:UsersAdminAppDataLocalMicrosoftWindowsApps;C:UsersAdminAppDataRoamingnpm
9 verbose lifecycle mern-stack-tasks@1.0.0~webpack: CWD: C:UsersAdminDesktopMERN-STACK-TASKS
10 silly lifecycle mern-stack-tasks@1.0.0~webpack: Args: [ '/d /s /c', 'webpack --mode=development' ]
11 silly lifecycle mern-stack-tasks@1.0.0~webpack: Returned: code: 2 signal: null
12 info lifecycle mern-stack-tasks@1.0.0~webpack: Failed to exec webpack script
13 verbose stack Error: mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid mern-stack-tasks@1.0.0
15 verbose cwd C:UsersAdminDesktopMERN-STACK-TASKS
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "webpack"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
22 error Exit status 2
23 error Failed at the mern-stack-tasks@1.0.0 webpack script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
and these are the issues
C:UsersAdminDesktopMERN-STACK-TASKS>npm run webpack
> mern-stack-tasks@1.0.0 webpack C:UsersAdminDesktopMERN-STACK-TASKS
> webpack --mode=development
Hash: e7f652b71ffb968075a8
Version: webpack 4.25.1
Time: 3188ms
Built at: 2018-11-13 16:12:51
Asset Size Chunks Chunk Names
main.js 2.82 MiB main [emitted] main
Entrypoint main = main.js
[0] ./streams (ignored) 15 bytes {main} [built]
[1] ./extend-node (ignored) 15 bytes {main} [built]
[2] util (ignored) 15 bytes {main} [built]
[3] util (ignored) 15 bytes {main} [built]
[4] http (ignored) 15 bytes {main} [built]
[5] buffer (ignored) 15 bytes {main} [optional] [built]
[6] crypto (ignored) 15 bytes {main} [optional] [built]
[./node_modules/express/lib sync recursive] ./node_modules/express/lib sync 160 bytes {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
[./src/database.js] 302 bytes {main} [built]
[./src/index.js] 1.14 KiB {main} [built]
[./src/models/task.js] 258 bytes {main} [built]
[./src/routes/task.routes.js] 1.13 KiB {main} [built]
+ 400 hidden modules
WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesdestroy'
@ ./node_modules/destroy/index.js 14:17-30
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesetag'
@ ./node_modules/etag/index.js 22:12-25
@ ./node_modules/express/lib/utils.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/view.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/view.js 18:9-22
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/mime/mime.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesmime'
@ ./node_modules/mime/mime.js 2:9-22
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/send/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulessend'
@ ./node_modules/send/index.js 23:9-22
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/request.js 18:11-25
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mern-stack-tasks@1.0.0 webpack 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:UsersAdminAppDataRoamingnpm-cache_logs2018-11-13T19_12_51_743Z-debug.log
C:UsersAdminDesktopMERN-STACK-TASKS>npm run dev
> mern-stack-tasks@1.0.0 dev C:UsersAdminDesktopMERN-STACK-TASKS
> nodemon src/index.js
by the way this thing didn't worked, i checked on github with guys having a similar issue, but it looks like this is not the case for me
node: {
fs: 'empty'
}
thanks in advance, and sorry for this convoluted post
webpack mern
I'm very new on this MERN web app thing, and following several tutorials on youtube, ended up on this particular tutorial, this guy uses webpack, and runs the command line from the package.json script, did pretty much the same steps, but in my case, i get a ton of erros and warnings, not sure what i did wrong, this is the log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'webpack' ]
2 info using npm@6.4.1
3 info using node@v8.12.0
4 verbose run-script [ 'prewebpack', 'webpack', 'postwebpack' ]
5 info lifecycle mern-stack-tasks@1.0.0~prewebpack: mern-stack-tasks@1.0.0
6 info lifecycle mern-stack-tasks@1.0.0~webpack: mern-stack-tasks@1.0.0
7 verbose lifecycle mern-stack-tasks@1.0.0~webpack: unsafe-perm in lifecycle true
8 verbose lifecycle mern-stack-tasks@1.0.0~webpack: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:UsersAdminDesktopMERN-STACK-TASKSnode_modules.bin;C:Program Files (x86)Python37-32Scripts;C:Program Files (x86)Python37-32;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:WINDOWSSystem32OpenSSH;C:Program Filesdotnet;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesMicrosoft VS Codebin;C:Program Filesnodejs;C:UsersAdminAppDataLocalMicrosoftWindowsApps;C:UsersAdminAppDataRoamingnpm
9 verbose lifecycle mern-stack-tasks@1.0.0~webpack: CWD: C:UsersAdminDesktopMERN-STACK-TASKS
10 silly lifecycle mern-stack-tasks@1.0.0~webpack: Args: [ '/d /s /c', 'webpack --mode=development' ]
11 silly lifecycle mern-stack-tasks@1.0.0~webpack: Returned: code: 2 signal: null
12 info lifecycle mern-stack-tasks@1.0.0~webpack: Failed to exec webpack script
13 verbose stack Error: mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
13 verbose stack Exit status 2
13 verbose stack at EventEmitter.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecycleindex.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclelibspawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:915:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid mern-stack-tasks@1.0.0
15 verbose cwd C:UsersAdminDesktopMERN-STACK-TASKS
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "webpack"
18 verbose node v8.12.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 2
22 error mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`
22 error Exit status 2
23 error Failed at the mern-stack-tasks@1.0.0 webpack script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
and these are the issues
C:UsersAdminDesktopMERN-STACK-TASKS>npm run webpack
> mern-stack-tasks@1.0.0 webpack C:UsersAdminDesktopMERN-STACK-TASKS
> webpack --mode=development
Hash: e7f652b71ffb968075a8
Version: webpack 4.25.1
Time: 3188ms
Built at: 2018-11-13 16:12:51
Asset Size Chunks Chunk Names
main.js 2.82 MiB main [emitted] main
Entrypoint main = main.js
[0] ./streams (ignored) 15 bytes {main} [built]
[1] ./extend-node (ignored) 15 bytes {main} [built]
[2] util (ignored) 15 bytes {main} [built]
[3] util (ignored) 15 bytes {main} [built]
[4] http (ignored) 15 bytes {main} [built]
[5] buffer (ignored) 15 bytes {main} [optional] [built]
[6] crypto (ignored) 15 bytes {main} [optional] [built]
[./node_modules/express/lib sync recursive] ./node_modules/express/lib sync 160 bytes {main} [built]
[./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 489 bytes {main} [built]
[./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {main} [built]
[./src/database.js] 302 bytes {main} [built]
[./src/index.js] 1.14 KiB {main} [built]
[./src/models/task.js] 258 bytes {main} [built]
[./src/routes/task.routes.js] 1.13 KiB {main} [built]
+ 400 hidden modules
WARNING in ./node_modules/express/lib/view.js 81:13-25
Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/destroy/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesdestroy'
@ ./node_modules/destroy/index.js 14:17-30
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/etag/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesetag'
@ ./node_modules/etag/index.js 22:12-25
@ ./node_modules/express/lib/utils.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/view.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/view.js 18:9-22
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/mime/mime.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesmime'
@ ./node_modules/mime/mime.js 2:9-22
@ ./node_modules/send/index.js
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/send/index.js
Module not found: Error: Can't resolve 'fs' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulessend'
@ ./node_modules/send/index.js 23:9-22
@ ./node_modules/express/lib/response.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
ERROR in ./node_modules/express/lib/request.js
Module not found: Error: Can't resolve 'net' in 'C:UsersAdminDesktopMERN-STACK-TASKSnode_modulesexpresslib'
@ ./node_modules/express/lib/request.js 18:11-25
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./src/index.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mern-stack-tasks@1.0.0 webpack: `webpack --mode=development`npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mern-stack-tasks@1.0.0 webpack 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:UsersAdminAppDataRoamingnpm-cache_logs2018-11-13T19_12_51_743Z-debug.log
C:UsersAdminDesktopMERN-STACK-TASKS>npm run dev
> mern-stack-tasks@1.0.0 dev C:UsersAdminDesktopMERN-STACK-TASKS
> nodemon src/index.js
by the way this thing didn't worked, i checked on github with guys having a similar issue, but it looks like this is not the case for me
node: {
fs: 'empty'
}
thanks in advance, and sorry for this convoluted post
webpack mern
webpack mern
asked Nov 13 '18 at 19:33
Nicolas SilvaNicolas Silva
113
113
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288293%2fgetting-errors-with-webpack-mern-full-stack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53288293%2fgetting-errors-with-webpack-mern-full-stack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown