3

I am currently going through learning Node.js and as such I am following along a tutorial on YouTube, in this he makes use of Webpack. On the video when he types in webpack into his terminal it works correctly, however if I typed into my terminal webpack I get a message saying it is not recognized.

I saw a post on here where it said the fix was setting the environment path for npm, which I did. It still wasn't working so I restarted my computer and then installed webpack again, however I still get the same issue.

Are there any steps that I am missing which allows me to make use of webpack?

BenJ30
  • 86
  • 1
  • 8
  • Which Os are you using? – Jahid Hasan Feb 04 '18 at 14:55
  • Hi @JahidHasan I am running it on Windows 10. – BenJ30 Feb 04 '18 at 14:58
  • So, you are using power shell if are not using bash on ubuntu.You can find your solution here https://stackoverflow.com/questions/35810172/webpack-is-not-recognized-as-a-internal-or-external-command-operable-program-or – Jahid Hasan Feb 04 '18 at 15:12
  • This was the topic I tried first time, I run Powershell as an administrator, add that in and then I close powershell and open it up again to check it within that, if I then change directory to my project and do webpack I get the same error stating that it is not recognized. – BenJ30 Feb 04 '18 at 15:18
  • 2
    Just adding onto that - I manged to run it via 'node_modules\.bin\webpack' on that topic, which works fine, I'm just unaware how to get the 'shortcut' to work by simply using 'webpack' in the terminal. – BenJ30 Feb 04 '18 at 15:33
  • 1
    FYI - if you are using npm v5.2 you can use npx - https://alligator.io/workflow/npx/ and just run `npx webpack` – olore Feb 04 '18 at 16:10

0 Answers0