0
votes
In the browser: Unable to locate Mix file: /vendor/perfect-scrollbar.css. (View: E:\xampp\htdocs\stacklaravel\resources\views\vendor\stack\partials\header.blade.php)

npm run watch says some problems!

I faced an error npm run watch

  • 0 info it worked if it ends with ok

    1 verbose cli [

    1 verbose cli 'C:\Program Files\nodejs\node.exe',

    1 verbose cli 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js',

    1 verbose cli 'run',

    1 verbose cli 'watch'

    1 verbose cli ]

    2 info using [email protected]

    3 info using [email protected]

    4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]

    5 info lifecycle @~prewatch: @

    6 info lifecycle @~watch: @

    7 verbose lifecycle @~watch: unsafe-perm in lifecycle true

    8 verbose lifecycle @~watch: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm- lifecycle\node-gyp-bin;E:\xampp\htdocs\stacklaravel\node_modules.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Git\cmd;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Azure Data Studio\bin;C:\Windows\System32\OpenSSH;C:\OpenSSH-Win64;C:\ProgramData\ComposerSetup\bin;C:\Program Files (x86)\dotnet;C:\Program Files\nodejs;C:\laragon\bin;C:\laragon\bin\apache\httpd-2.4.35-win64-VC15\bin;C:\laragon\bin\composer;C:\laragon\bin\laragon\utils;C:\laragon\bin\mysql\mysql-5.7.24-winx64\bin;C:\laragon\bin\nginx\nginx-1.16.0;C:\laragon\bin\ngrok;C:\laragon\bin\notepad++;C:\laragon\bin\edited\php\php-7.2.19-Win32-VC15-x64;C:\laragon\bin\putty;C:\laragon\bin\redis\redis-x64-3.2.100;C:\laragon\bin\telnet;C:\laragon\usr\bin;C:\Users\Prosigns\AppData\Local\Yarn\config\global\node_modules.bin;C:\Users\Prosigns\AppData\Roaming\Composer\vendor\bin;C:\Users\Prosigns\AppData\Local\Microsoft\WindowsApps;C:\Users\Prosigns\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;F:\xampp\edited\php;E:\xampp\php; C:\Users\Prosigns\AppData\Roaming\Composer\vendor\bin;C:\Users\Prosigns\AppData\Roaming\npm

    9 verbose lifecycle @~watch: CWD: E:\xampp\htdocs\stacklaravel

    10 silly lifecycle @~watch: Args: [ '/d /s /c', 'mix watch' ]

    11 silly lifecycle @~watch: Returned: code: 2 signal: null

    12 info lifecycle @~watch: Failed to exec watch script

    13 verbose stack Error: @ watch: mix watch

    13 verbose stack Exit status 2

    13 verbose stack at EventEmitter. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)

    13 verbose stack at EventEmitter.emit (events.js:315:20)

    13 verbose stack at ChildProcess. (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)

    13 verbose stack at ChildProcess.emit (events.js:315:20)

    13 verbose stack at maybeClose (internal/child_process.js:1048:16)

    13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)

    14 verbose pkgid @

    15 verbose cwd E:\xampp\htdocs\stacklaravel

    16 verbose Windows_NT 10.0.16299

    17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "run" "watch"

    18 verbose node v14.15.4

    19 verbose npm v6.14.10

    20 error code ELIFECYCLE

    21 error errno 2

    22 error @ watch: mix watch

    22 error Exit status 2

    23 error Failed at the @ watch script.

    23 error This is probably not a problem with npm. There is likely additional logging output above.

    24 verbose exit [ 2, true ]

What is the cause if these errors? How can i fix it?

1
Welcome to StackOverflow. Please refer to guidelines for asking questions. You need to give a lot more details about your issue for someone to try and help you. stackoverflow.com/help/how-to-ask - Ananda

1 Answers

0
votes

This issue is caused by not having nodejs installed or by having an out of date version of nodejs.

When I had this issue I found out I was running node v.10.19.0, I upgraded to 15.6.0 and now it works.

I’m running Ubuntu 20.04, if you are too try the following commands:

sudo apt update
curl -sL https://deb.nodesource.com/setup_15.x | sudo bash -
sudo apt-get install -y nodejs
node -v