Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Kekica9496y@devemperor In scripts sections are only 'build' and 'start' but you are trying to run 'dev'
-
Kekica9496yMy advice: start some nodejs tutorials/course for beginners and leave webpack for some time.
-
Kekica9496yIf you follow a tutorial how to do this you are clearly not following the steps correctly.
-
@devemperor
I'm assuming you've done "npm install" successfully already, since there's a node_modules directory in your project.
Try this just for funsies - in the start script in package.json, add the full path to webpack-dev-server - eg. "node_modules/someDir/webpack-dev-server"
If that runs, you've either not installed webpack-dev-server gloablly, or it wasn't added to PATH properly on install -
@xPunxNotDeadx you Taliban.
Never install a dev depency globally.
He's running a npm script. What matters is node_modules/.bin content and nothing else. -
@devTea i guess the webpack is for frontend. I run into similar problem with react. Solve the problem by creating seperate npm projects for server and frontend. Node.js seems handle most es5 syntax without transform. Arrow, async etc.
-
jeeper59666yAlways run node --version. I have had the wrong version selected many times. Use NVM to manage the
-
@sunfishcc https://node.green
Node handle most es7 syntax.
The real difference in using webpack resides in all the loaders you can use (think module aliasing for instance) and how the code gets bundled afterwards (which is useless with node) -
@jeeper agreed although he's using gitbash and nvm for windows isn't a paragon of stability
-
jeeper59666y@Commodore it's also terrible about fully uninstalling things. Dangling settings can live many unsuspecting places
-
@Commodore you're right, but if he's successfully run npm install then something is borked - global install will prove or disprove this.
My bet; OP hasn't run npm install successfully yet. Delete node_modules and npm install - ideally from PS console instead of bash to rule out winderps+bash issues -
Fixed it. npm wasn't intalled successfully cause I ran the installation through vs code bash than PS. I removed the modules and reinstalled it again. thanks guys.
Related Rants
-
gururaju53*Now that's what I call a Hacker* MOTHER OF ALL AUTOMATIONS This seems a long post. but you will definitely ...
-
tahnik63So I need to create a nice new web app. Let's look at some cool JS frameworks that I can work with. *5 mins l...
-
ahmedam23What only relying on JavaScript for HTML form input validation looks like
I have reinstalled node js 3 times to run JS scripts and "npm run dev" is not starting up the server. This is quite frustrating.
rant
bash
js
node js
newbie
webpack