error log on npm start - node.js

I know there is a lot of questions about that but I can't resolve it by myself, because I'm not sure about what the error log talks about.
Here it is:
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 'start' ]
2 info using npm#2.5.1
3 info using node#v0.12.1
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 verbose run-script [ 'prestart', 'start', 'poststart' ]
6 info prestart essai_mongo#0.0.0
7 info start essai_mongo#0.0.0
8 verbose unsafe-perm in lifecycle true
9 info essai_mongo#0.0.0 Failed to exec start script
10 verbose stack Error: essai_mongo#0.0.0 start: `node ./bin/www`
10 verbose stack Exit status 1
10 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:213:16)
10 verbose stack at EventEmitter.emit (events.js:110:17)
10 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:14:12)
10 verbose stack at ChildProcess.emit (events.js:110:17)
10 verbose stack at maybeClose (child_process.js:1008:16)
10 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
11 verbose pkgid essai_mongo#0.0.0
12 verbose cwd C:\Users\***\essai_mongo
13 error Windows_NT 6.1.7601
14 error argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
15 error node v0.12.1
16 error npm v2.5.1
17 error code ELIFECYCLE
18 error essai_mongo#0.0.0 start: `node ./bin/www`
18 error Exit status 1
19 error Failed at the essai_mongo#0.0.0 start script 'node ./bin/www'.
19 error This is most likely a problem with the essai_mongo package,
19 error not with npm itself.
19 error Tell the author that this fails on your system:
19 error node ./bin/www
19 error You can get their info via:
19 error npm owner ls essai_mongo
19 error There is likely additional logging output above.
20 verbose exit [ 1, true ]
Also, here is my package.json
{
"name": "essai_mongo",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.12.0",
"cookie-parser": "~1.3.4",
"debug": "~2.1.1",
"express": "~4.12.2",
"jade": "~1.9.2",
"morgan": "~1.5.1",
"serve-favicon": "~2.2.0",
"mongoose": "^4.0.0"
}
}
I don't know if i't about administratot rights, start path on package.json (I've tried C:\Users\***\essai_mongo\bin\www), environment variable,.. Any help would be appreciate

Related

Next JS compiling issue mutable globals cannot be exported

Failed to compile.
./assets/images/cross.png
CompileError: AsyncCompile: Wasm decoding failed: mutable globals cannot be exported #+482
> Build error occurred
Error: > Build failed because of webpack errors
at nextBuildSpan.traceAsyncFn (/var/app/kv-v2/node_modules/next/dist/build/index.js:15:924)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! kv-update#1.7.3 build: `next build`
npm ERR! Exit status 1
I am getting this error when trying to npm run build on my ubuntu server it was working fine previously and it is still compiling fine on my localhost windows machine so to be sure it was not due to my code I reverted to the old copy from Github that was working but its still getting the same error when compiling. I did remove the node_modules and reinstalled.
I tried Googling and there were around 10 articles of this none of them were able to fix my issue. Please help me. Thank you. This is the full log file.
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ]
2 info using npm#6.14.4
3 info using node#v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle kv-update#1.7.3~prebuild: kv-update#1.7.3
6 info lifecycle kv-update#1.7.3~build: kv-update#1.7.3
7 verbose lifecycle kv-update#1.7.3~build: unsafe-perm in lifecycle true
8 verbose lifecycle kv-update#1.7.3~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/app/kv-v2/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle kv-update#1.7.3~build: CWD: /var/app/kv-v2
10 silly lifecycle kv-update#1.7.3~build: Args: [ '-c', 'next build' ]
11 silly lifecycle kv-update#1.7.3~build: Returned: code: 1 signal: null
12 info lifecycle kv-update#1.7.3~build: Failed to exec build script
13 verbose stack Error: kv-update#1.7.3 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid kv-update#1.7.3
15 verbose cwd /var/app/kv-v2
16 verbose Linux 5.4.0-109-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build"
18 verbose node v10.19.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error kv-update#1.7.3 build: `next build`
22 error Exit status 1
23 error Failed at the kv-update#1.7.3 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json file
{
"name": "kvr",
"version": "1.7.3",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start -p 4000",
"lint": "next lint"
},
"dependencies": {
"#notbaldrick/react-crossfade-carousel": "^1.0.4",
"babel-plugin-styled-components": "^1.13.1",
"fathom-client": "^3.1.0",
"jsonp": "^0.2.1",
"next": "11.0.1",
"npm": "^6.14.4",
"react": "17.0.2",
"react-device-detect": "^1.17.0",
"react-dom": "17.0.2",
"react-facebook-pixel": "^1.0.4",
"react-img-carousel": "^2.1.1",
"react-responsive-carousel": "^3.2.19",
"react-transition-group": "^4.4.2",
"styled-components": "^5.3.0"
},
"devDependencies": {
"babel-plugin-styled-components": "^1.13.1",
"eslint": "7.30.0",
"eslint-config-next": "11.0.1"
}
}
I did fix it by removing the cross.png file converting it to cross.jpg and updated the code everything it is importing this file. Strange bug It seems.

next.js with-mongodb build error. error on `next build`?

I am trying to build a next.js project with-mongodb on it but its not working and im not sure why. The log doesn't appear to be very helpful with that the issue is (as far as i can tell) and so im not sure how to fix it. here is a copy of the log;
0 info it worked if it ends with ok
1 verbose cli [
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 'build'
1 verbose cli ]
2 info using npm#6.14.9
3 info using node#v14.15.3
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle with-mongodb#0.1.0~prebuild: with-mongodb#0.1.0
6 info lifecycle with-mongodb#0.1.0~build: with-mongodb#0.1.0
7 verbose lifecycle with-mongodb#0.1.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle with-mongodb#0.1.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\Creative\Programming\VS code\quote-db\node_modules\.bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Oculus\Support\oculus-runtime;C:\Python39\Scripts\;C:\Python39\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\PuTTY\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Calibre2\;C:\Program Files\nodejs\;C:\Program Files (x86)\Touch Portal\plugins\adb\platform-tools;C:\Program Files\Git\cmd;C:\Users\user_\AppData\Local\Microsoft\WindowsApps;C:\Users\user_\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\user_\AppData\Roaming\npm
9 verbose lifecycle with-mongodb#0.1.0~build: CWD: E:\Creative\Programming\VS code\quote-db
10 silly lifecycle with-mongodb#0.1.0~build: Args: [ '/d /s /c', 'next build' ]
11 silly lifecycle with-mongodb#0.1.0~build: Returned: code: 1 signal: null
12 info lifecycle with-mongodb#0.1.0~build: Failed to exec build script
13 verbose stack Error: with-mongodb#0.1.0 build: `next build`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1048:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid with-mongodb#0.1.0
15 verbose cwd E:\Creative\Programming\VS code\quote-db
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v14.15.3
19 verbose npm v6.14.9
20 error code ELIFECYCLE
21 error errno 1
22 error with-mongodb#0.1.0 build: `next build`
22 error Exit status 1
23 error Failed at the with-mongodb#0.1.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
EDIT: here is my package.json file.
{
"name": "with-mongodb",
"version": "0.1.0",
"scripts": {
"debug": "cross-env NODE_OPTIONS='--inspect' next dev",
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"cross-env": "^7.0.3",
"mongodb": "^3.5.9",
"next": "latest",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-import": "^14.0.0",
"postcss-preset-env": "^6.7.0",
"precss": "^4.0.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"sass": "^1.32.8",
"swr": "^0.4.2",
"tailwindcss": "^2.0.3"
},
"license": "MIT"
}
Today I tried again and recieved a proper error message.
ModuleNotFoundError: Module not found: Error: Can't resolve '../styles/main.module.scss' in 'E:\Creative\Programming\VS code\quote-db\pages'
I'm not sure what changed, but this is now solved. Presumably restarting my PC had something to do with it?

'npm start' gives an error and does not start the development server

I'm new to node and react and am trying to start a local development server for my react app. To start it I did npm start but this put out an error. The log looks like this:
0 info it worked if it ends with ok
1 verbose cli [
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 'start'
1 verbose cli ]
2 info using npm#6.14.4
3 info using node#v12.16.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle myapp#0.1.0~prestart: myapp#0.1.0
6 info lifecycle myapp#0.1.0~start: myapp#0.1.0
7 verbose lifecycle myapp#0.1.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle myapp#0.1.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;E:\full-stack projects\react tutoral\myapp\node_modules\.bin;C:\Program Files\Git\mingw32\bin;C:\Program Files\Git\usr\bin;C:\Users\User\bin;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\Program Files\PostgreSQL\10\bin;C:\Program Files\PostgreSQL\10\libC;C:\Program Files\Git\Python27;C:\Python27\scripts;C:\Users\User\AppData\Local\Programs\Python\Python37-32;C:\Users\User\AppData\Local\Programs\Python\Python37-32\Scripts;C:\Program Files\nodejs;C:\Users\User\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\heroku\bin;C:\Users\User\AppData\Roaming\npm
9 verbose lifecycle myapp#0.1.0~start: CWD: E:\full-stack projects\react tutoral\myapp
10 silly lifecycle myapp#0.1.0~start: Args: [ '/d /s /c', 'react-scripts start' ]
11 silly lifecycle myapp#0.1.0~start: Returned: code: 1 signal: null
12 info lifecycle myapp#0.1.0~start: Failed to exec start script
13 verbose stack Error: myapp#0.1.0 start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:310:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:310:20)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid myapp#0.1.0
15 verbose cwd E:\full-stack projects\react tutoral\myapp
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.3
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error myapp#0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the myapp#0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
How do I fix this?
EDIT
Here is the package.json for the app:
{
"name": "myapp",
"version": "0.1.0",
"private": true,
"dependencies": {
"#testing-library/jest-dom": "^4.2.4",
"#testing-library/react": "^9.5.0",
"#testing-library/user-event": "^7.2.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
EDIT 2
I have tried all the solutions suggested, but it always shows the same errror. Here is how the error is shown in the termianl (bash):
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
←[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)←[39m
←[90m at onErrorNT (internal/child_process.js:469:16)←[39m
←[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)←[39m
Emitted 'error' event on ChildProcess instance at:
←[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)←[39m
←[90m at onErrorNT (internal/child_process.js:469:16)←[39m
←[90m at processTicksAndRejections (internal/process/task_queues.js:84:21)←[39m {
errno: ←[32m'ENOENT'←[39m,
code: ←[32m'ENOENT'←[39m,
syscall: ←[32m'spawn cmd'←[39m,
path: ←[32m'cmd'←[39m,
spawnargs: [ ←[32m'/s'←[39m, ←[32m'/c'←[39m, ←[32m'start'←[39m, ←[32m'""'←[39m, ←[32m'/b'←[39m, ←[32m'"http://localhost:3000"'←[39m ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp#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-05-07T16_48_16_197Z-debug.log
ignore this line. Stackoverflow requires me to describe the problem in details since most of this is code
Ok so this problem was with the Windows system32 variable. Its actually really easy to solve. Just add the following to the PATH variable:
C:\Windows\System32

nodejs webpack server not starting

I am new to NodeJs and trying to setup react app. Getting following error on the console while starting the server.
Not able to start the server, have tried several options.
c:\Users\vaibhav\Desktop\node>npm start
> test#1.0.0 start c:\Users\vaibhav\Desktop\node
> webpack-dev-server --hot
x ?wds?: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property 'loaders'. These properties are valid:
object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test#1.0.0 start: `webpack-dev-server --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\vaibhav\AppData\Roaming\npm-cache\_logs\2018-09-06T17_00_03
_303Z-debug.log
The log file shows the following error:
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 'start' ]
2 info using npm#5.6.0
3 info using node#v8.11.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle test#1.0.0~prestart: test#1.0.0
6 info lifecycle test#1.0.0~start: test#1.0.0
7 verbose lifecycle test#1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle test#1.0.0~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;c:\Users\vaibhav\Desktop\node\node_modules\.bin;C:\Windows;C:\Windows\system32;C:\Windows\system32\wbem;C:\ProgramData\Oracle\Java\javapath;C:\app\vaibhav\product\11.2.0\client_1\bin;C:\Program Files (x86)\Attachmate\E!E2K\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Attachmate\Reflection\;C:\Users\vaibhav\AppData\Local\Programs\Python\Python36;C:\Users\vaibhav\AppData\Local\Programs\Python\Python36\Scripts;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\1E\NomadBranch\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\TortoiseSVN\bin;C:\Users\vaibhav\Documents\softwares\apache-maven-3.3.3\bin;C:\Program Files (x86)\GNU\GnuPG;C:\Program Files (x86)\Enterprise Vault\EVClient\;C:\Program Files (x86)\Java\jre1.8.0_152\bin;C:\Program Files (x86)\WebEx\Productivity Tools;C:\Program Files (x86)\CheckPoint\Endpoint Security\Endpoint Common\bin;C:\Program Files\nodejs\;C:\Users\vaibhav\AppData\Local\GitHubDesktop\bin;C:\Program Files\Microsoft VS Code\bin;C:\Users\vaibhav\AppData\Roaming\npm
9 verbose lifecycle test#1.0.0~start: CWD: c:\Users\vaibhav\Desktop\node
10 silly lifecycle test#1.0.0~start: Args: [ '/d /s /c', 'webpack-dev-server --hot' ]
11 silly lifecycle test#1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle test#1.0.0~start: Failed to exec start script
13 verbose stack Error: test#1.0.0 start: `webpack-dev-server --hot`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285: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 Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.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:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid test#1.0.0
15 verbose cwd c:\Users\vaibhav\Desktop\node
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v8.11.4
19 verbose npm v5.6.0
20 error code ELIFECYCLE
21 error errno 1
22 error test#1.0.0 start: `webpack-dev-server --hot`
22 error Exit status 1
23 error Failed at the test#1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
My package.json looks like the following:
{
"name": "test",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --hot"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^8.0.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"react": "^16.4.2",
"react-dom": "^16.4.2",
"webpack": "^4.17.2",
"webpack-dev-server": "^3.1.7"
},
"devDependencies": {
"webpack-cli": "^3.1.0"
}
}
Please let me know in case you require more details. I will provide that in comments.
The answer is in your question:
wds?: Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
- configuration.module has an unknown property 'loaders'. These properties are valid: object { exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, strictExportPresence?, strictThisContextOnImports? }
In your config, instead of module.loaders, it has to be module.rules.

npm start not working while installing react

Please see the below files for reference. I am not able to start the npm start command while creating set up for react demo project.
**package.json**
{
"name": "package.json",
"version": "1.0.0",
"description": "Demo application",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server --hot"
},
"author": "Abhishek",
"license": "ISC",
"dependencies": {
"react": "^15.4.2",
"react-dom": "^15.4.2"
}
}
Webpack.config.js
var config = {
entry: './main.js',
output: {
path:'./',
filename: 'index.js',
},
devServer: {
inline: true,
port: 8080
},
module: {
loaders: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel',
query: {
presets: ['es2015', 'react']
}
}
]
}
}
module.exports = config;
Please find the below logs when I ran npm.start
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 'start' ]
2 info using npm#2.15.1
3 info using node#v4.4.4
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart package.json#1.0.0
6 info start package.json#1.0.0
7 verbose unsafe-perm in lifecycle true
8 info package.json#1.0.0 Failed to exec start script
9 verbose stack Error: package.json#1.0.0 start: `webpack-dev-server --hot`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:217:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:827:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid package.json#1.0.0
11 verbose cwd C:\Users\abhishek_pal02\Desktop\reactApp
12 error Windows_NT 6.3.9600
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
14 error node v4.4.4
15 error npm v2.15.1
16 error code ELIFECYCLE
17 error package.json#1.0.0 start: `webpack-dev-server --hot`
17 error Exit status 1
18 error Failed at the package.json#1.0.0 start script 'webpack-dev-server --hot'.
18 error This is most likely a problem with the package.json package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error webpack-dev-server --hot
18 error You can get information on how to open an issue for this project with:
18 error npm bugs package.json
18 error Or if that isn't available, you can get their info via:
18 error
18 error npm owner ls package.json
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
Please help to solve this error. Thanks in advance.
-Abhishek

Resources