events.js:183 throw Unhandled 'error' event - laravel

The system cannot find the path specified.
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn node_modules\webpack\bin\webpack.js ENOENT
at notFoundError (D:\xampp\htdocs\learnlarvel\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (D:\xampp\htdocs\learnlarvel\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (D:\xampp\htdocs\learnlarvel\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
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
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\iSkylarTechnology\AppData\Roaming\npm-cache_logs\2019-09-14T11_40_34_967Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev 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\iSkylarTechnology\AppData\Roaming\npm-cache_logs\2019-09-14T11_40_35_155Z-debug.log

Delete your node_modules folder and delete package-lock.json. Run npm cache clear --force and then npm install. Then try npm run dev or npm run watch.

Related

Why laravel mix copy function does not work?

im tryng to make a copy of a js file that exist in node_modules to the public folder to try to use the javascript files on node_modules only when i need in specific parts of the system.
when i try to make a copy using mix.copy('node_modules/select2/dist/select2.min.js', 'public/vendor/js/'). the error i get is:
[webpack-cli] [Error: ENOENT: no such file or directory, lstat 'C:\laragon\www\project\node_modules\select2\dist\select2.min.js'] {
errno: -4058,
code: 'ENOENT',
syscall: 'lstat',
path: 'C:\\laragon\\www\\project\\node_modules\\select2\\dist\\select2.min.js'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # development: `mix`
npm ERR! Exit status 2
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\OfficeUser\AppData\Roaming\npm-cache\_logs\2023-01-10T15_51_48_679Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev 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\OfficeUser\AppData\Roaming\npm-cache\_logs\2023-01-10T15_51_48_721Z-debug.log
What should i do now, is the file path incorrectly written?

Why did I get an error with npm run dev for my laravel project

cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
[webpack-cli] Error: Unknown option '--hide-modules'
[webpack-cli] Run 'webpack --help' to see available commands and options
npm ERR! code ELIFECYCLE
npm ERR! errno 2
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
npm ERR! Exit status 2
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! /root/.npm/_logs/2022-10-16T09_47_15_753Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # dev: npm run development
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev 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! /root/.npm/_logs/2022-10-16T09_47_15_777Z-debug.log

Laravel - npm run dev - Failed to find '~#fortawesome/fontawesome-pro/css/all.min.css'

I have created a project in Laravel 8, and when I run npm run dev it throws the following error:
ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '~#fortawesome/fontawesome-pro/css/all.min.css'
in [
/Users/me/Laravel/<projectName>/resources/sass
]
at resolveModule.catch.catch (/Users/me/Laravel/<projectName>/node_modules/postcss-import/lib/resolve-id.js:35:13)
at <anonymous>
# ./resources/sass/app.scss 2:14-253
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 2
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! /Users/me/.npm/_logs/2020-12-30T08_24_47_410Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! # dev: `npm run development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the # dev 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! /Users/me/.npm/_logs/2020-12-30T08_24_47_441Z-debug.log
My resources/sass/app.scss looks like this:
#import '~#fortawesome/fontawesome-pro/css/all.min.css';
I've tried with #import 'node_modules/#fortawesome/fontawesome-pro/css/all.min.css' as well, but that doesn't work either.
I can see all.min.css in the tree when I follow the path node_modules/#fortawesome/fontawesome-pro/css/all.min.css so I know for a fact that it's there.
Any help would be appreciated
You need to remove the ~ before the import line:
#import '#fortawesome/fontawesome-pro/css/all.min.css';

Failed to execute 'npm run dist' at command (node build/build-plugins.js) loader.js:775 MODULE_NOT_FOUND

I'm currently following a tooling setup from Bootstrap but I'm really having a hard time trying to understand this.
This is the source of the step-by-step process (https://getbootstrap.com/docs/4.3/getting-started/build-tools/)
Currently, I'm able to run npm scripts (e.g. npm run dist - according to the package.json file from Bootstrap)
During the command ('npm run dist') there's a command being executed as:
node build/build-plugins.js (My Bootstrap root folder doesn't have any build folder!)
Here's the log (using Git Bash - Windows)
> bootstrap#4.3.1 js-compile-plugins C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> node build/build-plugins.js
> bootstrap#4.3.1 css-compile-docs C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> cross-env-shell node-sass --output-style expanded --source-map true --source-map-contents true --precision 6 site/docs/$npm_package_version_short/assets/scss/docs.scss site/docs/$npm_package_version_short/assets/css/docs.min.css
> bootstrap#4.3.1 js-compile-plugins-coverage C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1
> cross-env NODE_ENV=test node build/build-plugins.js
internal/modules/cjs/loader.js:775
throw err;
^
Error: Cannot find module 'C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1\build\build-plugins.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
at Function.Module._load (internal/modules/cjs/loader.js:677:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap#4.3.1 js-compile-plugins-coverage: `cross-env NODE_ENV=test node build/build-plugins.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap#4.3.1 js-compile-plugins-coverage 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_217Z-debug.log
fs.js:127
throw err;
^
Error: ENOENT: no such file or directory, lstat 'C:\Workspace\risco-operacional\RiscoOperacional\packages\bootstrap.4.3.1\build'
at Object.realpathSync (fs.js:1512:7)
at runRollup (C:\Users\srebelo001\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup:1312:29)
at Object.<anonymous> (C:\Users\srebelo001\AppData\Roaming\npm\node_modules\rollup\dist\bin\rollup:1363:5)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11 {
errno: -4058,
syscall: 'lstat',
code: 'ENOENT',
path: 'C:\\Workspace\\risco-operacional\\RiscoOperacional\\packages\\bootstrap.4.3.1\\build'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap#4.3.1 js-compile-bundle: `rollup --environment BUNDLE:true --config build/rollup.config.js --sourcemap`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap#4.3.1 js-compile-bundle 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_354Z-debug.log
ERROR: "js-compile-plugins-coverage" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap#4.3.1 js-compile: `npm-run-all --parallel js-compile-* --sequential js-copy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap#4.3.1 js-compile 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_938Z-debug.log
ERROR: "js-compile" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap#4.3.1 js: `npm-run-all js-compile js-minify js-copy`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap#4.3.1 js 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_39_973Z-debug.log
ERROR: "js" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bootstrap#4.3.1 dist: `npm-run-all --parallel css js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bootstrap#4.3.1 dist 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\srebelo001\AppData\Roaming\npm-cache\_logs\2019-09-01T13_54_40_318Z-debug.log
You propably ran npm install bootstrap command to download the source code of Bootstrap so you're missing build folder.
Try to download the source code with Composer. These steps worked for me:
composer require twbs/bootstrap:4.5.0
cd .\vendor\twbs\bootstrap\
npm install
npm run dist
(Evn.: Windows 10 + PowerShell, installed npm, node.js, Ruby+Devkit with Bundler and Jekyll)
Recommended instructions: https://getbootstrap.com/docs/4.5/getting-started/build-tools/

npm run dev install errors on VM with laravel 5.4

I am trying to start using npm and vue for my front end development but having such a hard time starting. I am using scotchbox pro which is just a Vagrant box for development. I am running this VM on windows 10 and have a fresh install of laravel 5.4.
The default package.json is there (https://github.com/laravel/laravel/blob/master/package.json) and I have been trying to run npm install on the with no success for the last few days.
I am not sure where I should be looking for support on this issue since it could be laravel, npm, or my VM. It is so difficult for me to find a solid resource on how to get up and running!
Here is the npm run dev output that I get:
# dev /var/www
npm run development
# development /var/www
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress -hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
sh: 1: cross-env: not found
npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.10.3/bin/node" "/home/vagrant/.nvm/versions/node/v6.10.3/bin/npm" "run" "development"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
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`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the # development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/npm-debug.log
npm ERR! Linux 4.4.0-75-generic
npm ERR! argv "/home/vagrant/.nvm/versions/node/v6.10.3/bin/node" "/home/vagrant/.nvm/versions/node/v6.10.3/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/npm-debug.log
I found that changing my Vagrant file configuration fixed this issue as it was a folder permission issue.
config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

Resources