issues with running npm start on wsl2 - node.js

I'm transitioning from working on an ubuntu remote server that I accessed through ssh, to my local windows machine and wsl2
I don't know JS at all, but what worked on the server suddenly is not working on my computer at all. I've tried all different kinds of npm commands found here, but to no avail
This is the full error I'm getting
nick#GameCube:~/Winions.gg/frontend/my-app$ npm start
> my-app#0.1.0 start /home/nick/Winions.gg/frontend/my-app
> react-scripts start
/home/nick/Winions.gg/frontend/my-app/node_modules/eslint-webpack-plugin/node_modules/jest-worker/build/index.js:110
_ending;
^
SyntaxError: Unexpected token ;
at Module._compile (internal/modules/cjs/loader.js:723:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/home/nick/Winions.gg/frontend/my-app/node_modules/eslint-webpack-plugin/dist/getESLint.js:9:5)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
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! /home/nick/.npm/_logs/2022-12-11T03_44_57_094Z-debug.log
This is my package.json
{
"name": "my-app",
"version": "0.1.0",
"private": true,
"homepage": "https://winions.gg",
"dependencies": {
"#testing-library/jest-dom": "^5.16.5",
"#testing-library/react": "^13.4.0",
"#testing-library/user-event": "^13.5.0",
"axios": "^1.2.0",
"react": "^18.2.0",
"react-bootstrap": "^2.6.0",
"react-circular-progressbar": "^2.1.0",
"react-dom": "^18.2.0",
"react-icons": "^4.6.0",
"react-router-dom": "^6.4.3",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"babel-eslint": "^10.1.0"
}
}
I just want to be able to run the react app. God help me please

Copying from my comment so this shows up as answered in the feed:
Older versions of Node don't support public fields on classes. 12.4 is the first Node version to support that syntax, and Jest is transpiled from TypeScript to support Node 14 as of this date. This table is a good resource for finding out what newer features of EcmaScript are supported in which versions of Node.

Related

NodeJS and Express app error after deploy on azure web apps

After deploying node app with azure web app. An error appers about npm start. Project structure is simple app.js is like index.js.
App cant find a moongose module /helpers/simpleValidator.
I set up those variables in azure app config.
Environments variables
Logs
2022-08-21T02:25:53.042096825Z {"code":"MODULE_NOT_FOUND","level":"error","message":"Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js","requireStack":["/home/site/wwwroot/node_modules/mongoose/lib/schematype.js","/home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js","/home/site/wwwroot/node_modules/mongoose/lib/document.js","/home/site/wwwroot/node_modules/mongoose/lib/index.js","/home/site/wwwroot/node_modules/mongoose/index.js","/home/site/wwwroot/models/user.js","/home/site/wwwroot/routes/user.js","/home/site/wwwroot/startup/routes.js","/home/site/wwwroot/app.js"],"stack":"Error: Cannot find module './helpers/isSimpleValidator'\nRequire stack:\n- /home/site/wwwroot/node_modules/mongoose/lib/schematype.js\n- /home/site/wwwroot/node_modules/mongoose/lib/schema/mixed.js\n- /home/site/wwwroot/node_modules/mongoose/lib/document.js\n- /home/site/wwwroot/node_modules/mongoose/lib/index.js\n- /home/site/wwwroot/node_modules/mongoose/index.js\n- /home/site/wwwroot/models/user.js\n- /home/site/wwwroot/routes/user.js\n- /home/site/wwwroot/startup/routes.js\n- /home/site/wwwroot/app.js\n at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n at Function.Module._load (node:internal/modules/cjs/loader:778:27)\n at Module.require (node:internal/modules/cjs/loader:1005:19)\n at require (node:internal/modules/cjs/helpers:102:18)\n at Object. (/home/site/wwwroot/node_modules/mongoose/lib/schematype.js:13:27)\n at Module._compile (node:internal/modules/cjs/loader:1101:14)\n at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)\n at Module.load (node:internal/modules/cjs/loader:981:32)\n at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n at Module.require (node:internal/modules/cjs/loader:1005:19)"}
2022-08-21T02:25:53.082240581Z npm info lifecycle t******#1.0.0~start: Failed to exec start script
2022-08-21T02:25:53.120536311Z npm ERR! code ELIFECYCLE
2022-08-21T02:25:53.120575311Z npm ERR! errno 1
2022-08-21T02:25:53.120582912Z npm ERR! t******#1.0.0 start: `node app.js`
2022-08-21T02:25:53.120587512Z npm ERR! Exit status 1
2022-08-21T02:25:53.120591912Z npm ERR!
2022-08-21T02:25:53.120596112Z npm ERR! Failed at the t******#1.0.0 start script.
2022-08-21T02:25:53.120600812Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-08-21T02:25:53.213953705Z npm timing npm Completed in 18684ms
2022-08-21T02:25:53.213985605Z
2022-08-21T02:25:53.213992305Z npm ERR! A complete log of this run can be found in:
2022-08-21T02:25:53.213997205Z npm ERR! /root/.npm/_logs/2022-08-21T02_25_53_117Z-debug.log
2022-08-21T21:37:11.468408816Z npm ERR! taap#1.0.0 start: `node app.js`
2022-08-21T21:37:11.469692437Z npm ERR! Exit status 1
2022-08-21T21:37:11.476509148Z npm ERR!
2022-08-21T21:37:11.477776868Z npm ERR! Failed at the taap#1.0.0 start script.
2022-08-21T21:37:11.478919887Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2022-08-21T21:37:11.555158523Z npm timing npm Completed in 9802ms
2022-08-21T21:37:11.558920984Z
2022-08-21T21:37:11.558951084Z npm ERR! A complete log of this run can be found in:
2022-08-21T21:37:11.558972684Z npm ERR! /root/.npm/_logs/2022-08-21T21_37_11_479Z-debug.log
/home/LogFiles/2022_08_21_lw0sdlwk0001T3_docker.log (https://backendtaap.scm.azurewebsites.net/api/vfs/LogFiles/2022_08_21_lw0sdlwk0001T3_docker.log)
2022-08-21T04:07:01.722Z ERROR - Container backendtaap_0_4714aab5 for site backendtaap has exited, failing site start
Package.json
{
"name": "taap",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node app.js"
},
"engines": {
"node": ">=16.0.0"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.0.1",
"compression": "^1.7.4",
"config": "^3.3.7",
"cors": "^2.8.5",
"debug": "^4.3.3",
"dotenv": "^16.0.1",
"express": "^4.17.3",
"express-async-errors": "^3.1.1",
"helmet": "^5.0.2",
"joi": "^17.6.0",
"joi-objectid": "^4.0.2",
"joi-password-complexity": "^5.1.0",
"jsonwebtoken": "^8.5.1",
"lodash": "^4.17.21",
"mongoose": "^6.4.4",
"nodemon": "^2.0.15",
"swagger-jsdoc": "^6.2.1",
"swagger-parser": "^10.0.3",
"swagger-ui-express": "^4.4.0",
"winston": "^3.6.0",
"winston-mongodb": "^5.0.7"
}
}

I am getting error while using "npm start command for React application

I am new to react and this is my first application.
I have installed latest versions of node, npm/npx.
I created a directory using "create-react-app my-app".
After this when i enter the directory and type "npm start", I get the following error. Please help
C:\Users\admin\my-app>npm start
> my-app#0.1.0 start C:\Users\admin\my-app
> react-scripts start
Starting the development server...
events.js:288
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! 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\admin\AppData\Roaming\npm-cache\_logs\2020-04-12T15_19_48_491Z-debug.log
Here is my package.json content
{
"name": "my-app",
"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"
]
}
}
As suggested by some, I have deleted my node modules folder and then did npm update followed by npm install but still i am getting the same error. Any help would be very much appreciated
I have seen this before. Try deleting your node_modules folder and after that run npm update and then npm install.
If that doesn't work there are a few answers from another forums:
Some windows users said that add System32 to environment variables helped:
Goto Control Panel > System and Security > System > Advanced system settings > Enviroment variables and set a system variable to path C:\Windows\System32\ and restart your System.
Worst case scenario: downgrade react-scripts to 2.1.8 :
npm install react-scripts#2.1.8

Unable to deploy application on heroku

I am receiving the following error while deploying my application on heroku, I have deployed it before with no problems. I also have not changed the package.json file, so I am unsure why I am getting the following error.
There are no additional configs for heroku, the application was previously deployed, and cannot be updated.
The application is deployed currently under a previous version through the heroku website from my github.
Any help to resolve this issue would be greatly appreciated!
error from heroku
-----> Build
Running heroku-postbuild
> operations-reporting#1.0.0 heroku-postbuild /tmp/build_04594e22478b41fb98f830b9b12c2400
> NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client
added 86 packages from 287 contributors and audited 906755 packages in 16.658s
found 2 moderate severity vulnerabilities
run `npm audit fix` to fix them, or `npm audit` for details
> client#0.1.0 build /tmp/build_04594e22478b41fb98f830b9b12c2400/client
> react-scripts build
internal/modules/cjs/loader.js:800
throw err;
^
Error: Cannot find module 'es-abstract/2019/CreateDataProperty'
Require stack:
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js
- /tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
at Function.Module._load (internal/modules/cjs/loader.js:690:27)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js:3:26)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/implementation.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/object.getownpropertydescriptors/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/implementation.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/util.promisify/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/html-webpack-plugin/index.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/config/webpack.config.js',
'/tmp/build_04594e22478b41fb98f830b9b12c2400/client/node_modules/react-scripts/scripts/build.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client#0.1.0 build 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! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_533Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! operations-reporting#1.0.0 heroku-postbuild: `NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the operations-reporting#1.0.0 heroku-postbuild 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! /tmp/npmcache.PQkmQ/_logs/2019-12-14T21_42_39_547Z-debug.log
-----> Build failed
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- node_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
package.json
{
"name": "client",
"version": "0.1.0",
"main": "index.js",
"private": true,
"dependencies": {
"axios": "^0.19.0",
"config": "^3.2.4",
"express": "^4.17.1",
"express-validator": "^6.3.0",
"formik": "^2.0.6",
"mongoose": "^5.7.12",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0",
"react-table": "^6.10.3",
"reactstrap": "^8.1.1",
"schema-utils": "^2.6.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"
]
},
"devDependencies": {
"concurrently": "^5.0.0",
"nodemon": "^2.0.1"
},
"proxy": "http://localhost:5000"
}
Find the missing module and update your package like so:
npm install --save --save-exact foo#1.2.3
This is from heroku
Other solution:
heroku config:set NODE_MODULES_CACHE=false

Keep getting "cannot find module" errors when pushing React/Node app to Heroku

I'm trying to publish my site built with React, using create-react-app, and Node to Heroku and it keeps failing at the node-sass#4.12.0 install script.
I've tried npm install mkdirp which it says its missing, when I do that I get the same error except its looking for "glob". I install that, then its looking for "aproba." I know it can't be the solution to continue manually installing these packages.
Here are my package.json files. I have two set up for the client and server, they are in two different folders.
{
"name": "client",
"version": "1.0.0",
"private": true,
"proxy": "http://localhost:5000/",
"description": "",
"main": "src/index.js",
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-router-dom": "^5.0.1",
"react-scripts": "^3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"node-sass": "^4.12.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"author": "",
"license": "ISC"
}
{
"name": "server",
"version": "1.0.0",
"description": "",
"main": "index.js",
"author": "",
"license": "MIT",
"scripts": {
"start": "node server/server.js",
"heroku-postbuild": "cd client && npm install --only=dev && npm install && npm run build",
"server": "nodemon server/server.js",
"client": "npm run start --prefix client",
"dev": "concurrently \"npm run server\" \"npm run client\""
},
"dependencies": {
"body-parser": "^1.18.3",
"concurrently": "^3.5.1",
"cors": "^2.8.5",
"express": "^4.16.3",
"mysql": "^2.16.0"
},
"devDependencies": {
"nodemon": "^1.17.4",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1"
}
}
Here is the error I'm getting:
remote: -----> Build
remote: Running heroku-postbuild
remote:
remote: > server#1.0.0 heroku-postbuild /tmp/build_fa529f4bf2bafed6f44f8aecf630696b
remote: > cd client && npm install --only=dev && npm install && npm run build
remote:
remote:
remote: > node-sass#4.12.0 install /tmp/build_fa529f4bf2bafed6f44f8aecf630696b/client/node_modules/node-sass
remote: > node scripts/install.js
remote:
remote: internal/modules/cjs/loader.js:638
remote: throw err;
remote: ^
remote:
remote: Error: Cannot find module 'mkdirp'
remote: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
remote: at Function.Module._load (internal/modules/cjs/loader.js:562:25)
remote: at Module.require (internal/modules/cjs/loader.js:692:17)
remote: at require (internal/modules/cjs/helpers.js:25:18)
remote: at Object.<anonymous> (/tmp/build_fa529f4bf2bafed6f44f8aecf630696b/client/node_modules/node-sass/scripts/install.js:7:11)
remote: at Module._compile (internal/modules/cjs/loader.js:778:30)
remote: at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
remote: at Module.load (internal/modules/cjs/loader.js:653:32)
remote: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
remote: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! node-sass#4.12.0 install: `node scripts/install.js`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the node-sass#4.12.0 install script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Atom's comment helped me, but I'm new and can't write this there.
Changing heroku-postbuild to "cd client && npm install && npm run build" and adding node-sass to the server package.json fixed my issue as well!

React npm start throwing errors

I am creating a simple HelloWorld application using Node and react. I followed this tutorial when I run
npm start
I get the following error:
> test1#1.0.0 start C:\Users\Saeed\Work\Test1
> webpack-dev-server
The CLI moved into a separate package: webpack-cli.
Please install 'webpack-cli' in addition to webpack itself to use the CLI.
-> When using npm: npm install webpack-cli -D
-> When using yarn: yarn add webpack-cli -D
module.js:549
throw err;
^
Error: Cannot find module 'webpack-cli/bin/config-yargs'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\Saeed\Work\Test1\node_modules\webpack-dev-server\bin\webpack-dev-server.js:65:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test1#1.0.0 start: `webpack-dev-server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test1#1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
this is my package.json:
{
"name": "test1",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "webpack-dev-server",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"webpack": "^4.16.3",
"webpack-dev-server": "^3.1.5"
}
}
can anyone one point me out to my error? I npm install webpack-cli -D would solve the problem.

Resources