Laravel Mix: These dependencies were not found:
I have a fresh install of Laravel 5.4. I also have the following versions installed on my Windows node PC: 6.11.0 NPM: 5.0.3
I have already run npm install, however, when I run npm watch viewer, 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 searched the internet but it doesn't seem to work. Any help is appreciated.
source to share
Try to revert to this package.json. You can find it here:
https://github.com/laravel/laravel/blob/c1643bf0c59b6864fc55e09cce3bfafc67d29e2a/package.json
And try running it again, also make sure the folder is there node_modules/moment
.
source to share
I had the same problem but Leo_Kelmendi's solution did n't work for me.
Searching on GitHub, I found that there is a bug in NPM 5.2.0 that affects Laravel Mix. More on this here .
I had to revert NPM to its previous version in order to collect my data again:
$ sudo npm install -g npm@5.1.0
Then I removed all installed modules:
$ rm -rf node_modules/
$ npm cache clear --force
$ rm -rf package-lock.json
Please note that clearing the cache may take a while.
And finally, I reinstalled node deps and ran the dev
script:
$ npm install
$ npm run dev
source to share