Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'node_modules' is not recognized on Windows #2

Closed
tmswr opened this issue Oct 30, 2018 · 6 comments
Closed

'node_modules' is not recognized on Windows #2

tmswr opened this issue Oct 30, 2018 · 6 comments

Comments

@tmswr
Copy link

tmswr commented Oct 30, 2018

Great framework, however I cannot get any of the following commands to run on Windows:

  • npm run dev

  • npm run watch

  • npm run hot

  • npm run production

Using NPM or Yarn creates the following error:
image

@tmswr
Copy link
Author

tmswr commented Oct 30, 2018

@jack-pallot
Copy link
Owner

It looks like this is fairly common when using Laravel Mix on Windows. There's an issue about it here with a couple of solutions for amending paths inside package.json, I would give these methods a try first. If not you could also run npm update to get the latest dependancies.

@tmswr
Copy link
Author

tmswr commented Oct 30, 2018

I've tried the following but get the following:
10% building modules 1/1 modules 0 active
Webpack is watching the files... 95% emitting

It hangs past that. shrug

@jack-pallot
Copy link
Owner

I've had this before myself, but I can't remember how I fixed it. From memory I had to remove the node_modules folder and completely restart my machine to get the command prompt to behave again. That could just be coincidence though.

There are a couple solutions posted here, let me know if any of them work for you.

@tmswr
Copy link
Author

tmswr commented Nov 1, 2018

Here's what I did to make work for any other Windows user:

Add cross-env (don't forget to install it info) to the beginning of the dev, watch, hot, and production scripts.

Example "dev" script with changes:
"dev": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

I then had to modify the webpack.mix.js file by adding mix.setPublicPath('/') under the Laravel Mix Config. I hope this helps anyone else wanting to use this!

@tmswr tmswr closed this as completed Nov 1, 2018
@jack-pallot
Copy link
Owner

Good work, thanks for debugging. I'll have to test this further on Mac, as it looks like something that could be rolled in for a future release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants