Dalmar69's avatar

watch and watch--poll isnt working when i use mix.browserSync('{proxy: 'localhost:8000'}');

The webpack.mix.js

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css');

   mix.browserSync({proxy: 'localhost:8000'});

package.json file

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "compile-sass": "node-sass resources/assets/sass/app.scss public/css/app.css",
        "compile-sass-w": "node-sass resources/assets/sass/app.scss public/css/app.css -w"
    },
    "devDependencies": {
        "axios": "^0.18",
        "bootstrap": "^4.0.0",
        "popper.js": "^1.12",
        "cross-env": "^5.1",
        "laravel-mix": "^2.0",
        "lodash": "^4.17.4",
        "vue": "^2.5.7",
        "bourbon-neat": "^2.1.0",
        "gulp-uglify": "^3.0.0",
        "ionicons": "^3.0.0",
        "jquery": "^3.3.1",
        "node-sass": "^4.9.0"
    }
}

layout file with importing the css

 <head>       
        <!-- ionicons This is included in the plugins -->
        <link href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css" rel='stylesheet' type='text/css'>
        <link rel="stylesheet" href="{{ mixm('css/app.css') }}" type="text/css">
        <title>New Wave - @yield('title')</title>
    </head>
0 likes
1 reply
Dalmar69's avatar

Here is the error i get from the command line

PS C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave> npm run watch

> @ watch C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave
> npm run development -- --watch


> @ development C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"

Additional dependencies must be installed. This will only take a moment.
'yarn' is not recognized as an internal or external command,
operable program or batch file.
child_process.js:644
    throw err;
    ^

Error: Command failed: yarn add browser-sync [email protected] --dev
'yarn' is not recognized as an internal or external command,
operable program or batch file.

    at checkExecSyncError (child_process.js:601:13)
    at execSync (child_process.js:641:13)
    at installDependencies (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\Verify.js:127:5)
    at list.reject.tap.dependencies (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\Verify.js:84:17)
    at Array.value (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\helpers.js:24:13)
    at Function.dependencies (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\Verify.js:83:14)
    at concat.filter.tap.dependencies (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\components\ComponentFactory.js:131:24)
    at Array.value (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\helpers.js:24:13)
    at ComponentFactory.installDependencies (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\components\ComponentFactory.js:130:14)
    at Mix.listen (C:\Bitnami\wampstack-7.1.16-0\apache2\htdocs\_MyAppsLARACASTS_SNIPPET_PLACEHOLDER01_New Wave\NewWave\node_modules\laravel-mix\src\components\ComponentFactory.js:55:44)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\db_19\AppData\Roaming\npm-cache\_logs18-04-28T02_38_34_855Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\db_19\AppData\Roaming\npm-cache\_logs18-04-28T02_38_34_879Z-debug.log

Please or to participate in this conversation.