I have a fresh install of Laravel 5.4. I as well have the folowing versions installed on my Windows PC node: 6.11.0 npm:5.0.3
I have already run npm install, however, when i run npm run watch, i get the following error
> @ watch C:\xampp\htdocs\tu
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
10% building modules 1/1 modules 0 active
Webpack is watching the files…
95% emitting
ERROR Failed to compile with 2 errors 12:12:42 AM
These dependencies were not found:
* C:\xampp\htdocs\tu\resources\assets\js\app.js in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
* C:\xampp\htdocs\tu\resources\assets\sass\app.scss in multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
To install them, you can run: npm install --save C:\xampp\htdocs\tu\resources\assets\js\app.js C:\xampp\htdocs\tu\resources\assets\sass\app.scss
I've searched the internet but cant seem to get it working. Any help is appreciated.
I was having the exact same issue but Leo_Kelmendi's solution didn't work for me.
Searching on GitHub, I found there is a bug in NPM 5.2.0 that affects Laravel Mix. Read more about it here.
I had to revert NPM to its previous version in order to get my assets compiling again:
$ sudo npm install -g [email protected]
Then, I removed all installed modules:
$ rm -rf node_modules/
$ npm cache clear --force
$ rm -rf package-lock.json
Notice that clearing the cache may take a while.
And, finally, I reinstalled node deps and run the dev
script:
$ npm install
$ npm run dev
Try to revert to this package.json. You can find it here:
https://github.com/laravel/laravel/blob/c1643bf0c59b6864fc55e09cce3bfafc67d29e2a/package.json
And try to run it again, also make sure, there's a node_modules/moment
folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With