npm run dev script error

a friend and I figured it out. Weirdly enough, I had to use the command: npm link webpack to link it in from the global dependencies. Once that worked, i unlinked and then ran npm install webpack --save-dev and after that it started working. i dont know why it wasnt finding it from the local dependencies from when i had originally installed it.

Thank you all for your help.

update

the same thing just happened with: npm install webpack-dev-server --save-dev

i think it might have something to do with me potentially not being admin. everytime i have to install I have to enter sudo i thought i only had to do that if i wasnt the admin. Feel free to enlighten me about that.


I'm also following the same tutorial and had the same issue.

I tried all the above solutions and nothing worked.

I also tried what Jonas said on "Note lecture 133" to use the new updated command line, which also didn't work before his "lecture 134" about webpacks:

npm install --save-dev webpack@4 webpack-cli@2 webpack-dev-server@3

So, heres how I got npm run devworking:

If you watched carefully on "Lecture 134 and 135" Jonas was using webpack 4.2.0, webpack-cli 2.0.12 and there wasn't any webpack-dev-server installed either.

If you installed webpack previously, do the following:

On terminal, cd to the directory of the "9-forrkify" folder where you installed webpack and run the follow commands to uninstall webpack:

npm uninstall webpack-dev-server --save

npm uninstall webpack-cli --save

npm uninstall webpack --save

To install webpack correctly to follow along the tutorial, run the command:

npm install --save-dev [email protected] [email protected] [email protected]

npm run dev should work now properly with no errors at the console on chrome web browser.

For anyone that curious what tutorial we are all talking about:

"The Complete JavaScript Course 2020: Build Real Projects!" Here is the link: https://www.udemy.com/course/the-complete-javascript-course/