I developed laravel 5.4 project, and then hosted it, and I setup nodejs and other packages on server, but when edit in vuejs code, the change does not appear in the website.
I also run npm run dev but it shows error for me this is error:
npm ERR! code ELIFECYCLE
npm ERR! errno 126
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 126
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.
Related
I want to load vue Component in Public file using npm run watch , it gives me a message in watch dev or build ..?
Node.js v14.15.0.
npm 6.14.8
Laravel Installer 4.1.0
npm run watch
> # watch C:\Users\ANOOD\Desktop\Laravel&vueja\Laravel_vue
> npm run development -- --watch
> # development C:\Users\ANOOD\Desktop\Laravel&vueja\Laravel_vue
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
The system cannot find the path specified.
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn node_modules\webpack\bin\webpack.js ENOENT
at notFoundError (C:\Users\ANOOD\AppData\Roaming\npm\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\ANOOD\AppData\Roaming\npm\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (C:\Users\ANOOD\AppData\Roaming\npm\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\ANOOD\AppData\Roaming\npm\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn node_modules\\webpack\\bin\\webpack.js',
path: 'node_modules\\webpack\\bin\\webpack.js',
spawnargs: [
'--progress',
'--config=node_modules/laravel-mix/setup/webpack.config.js',
'--watch'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --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 WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ANOOD\AppData\Roaming\npm-cache\_logs\2020-11-10T12_23_34_863Z-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 WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ANOOD\AppData\Roaming\npm-cache\_logs\2020-11-10T12_23_35_071Z-debug.log
The problom was not on Laravel or npm or node_modules , simply it was the directory that I have been use when I put my laravel Project in Laravel every thing is ok but when I move it to another Directory calls Laravel&Vue it won't work and this problem apper.
Im trying to run npm run dev in my root directory, but I get this error:
npm run dev
> 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
[webpack-cli] Unknown argument: --hide-modules
? Which flags do you want to use? ...
√ Which flags do you want to use? · No items were selected
[webpack-cli]
Executing CLI
asset main.js 644 bytes [emitted] (name: main)
ERROR in main
Module not found: Error: Can't resolve './src' in 'C:\Users\xxxxx\Desktop\project'
webpack 5.2.0 compiled with 1 error in 56 ms
npm ERR! code 1
npm ERR! path C:\Users\xxxxxx\Desktop\project
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "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! A complete log of this run can be found in:
npm ERR! C:\Users\xxxxxx\AppData\Local\npm-cache\_logs\2020-10-26T01_53_38_098Z-debug.log
npm ERR! code 1
npm ERR! path C:\Users\xxxxxx\Desktop\project
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c "npm run development"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\xxxxx\AppData\Local\npm-cache\_logs\2020-10-26T01_53_38_149Z-debug.log
I have searched in everywhere but I cant find a solution! Any ideas?!?!
I had the same problem with Laravel 8.24.1 and I had to move the webpack.config.js out of the \app folder. Saw the suggestion from this answer.
Complete Laravel newbie here but I've googled for the past hour with no luck.
I've installed Laravel via composer (everything was working with the default set up) but I wanted to use bootstrap so I've installed npm, followed this guide here but when I run npm run dev I get an error:
Error in main
Module not found: Error: Can't resolve './src' in
'C:\xampp\htdocs...'
*Edited to include the rest of the error
webpack 5.3.1 compiled with 1 error in 69 ms
npm ERR! code 1
npm ERR! path C:\xampp\htdocs\laravelapp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "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! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2020-10-29T14_19_55_826Z-debug.log
npm ERR! code 1
npm ERR! path C:\xampp\htdocs\laravelapp
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "npm run development"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Local\npm-cache\_logs\2020-10-29T14_19_55_857Z-debug.log
Has anyone come across this before?
I installed a vue on laravel7. But npm run dev gives this error:
# development: cross-env NODE_ENV=development
node_modules/webpack/bin/webpack.js --progress --hide-modules
--config=node_modules/laravel-mix/setup/webpack.config.js
I installed cross-env, cleared cache, reinstalled node_modules, installed webpack, but they did not resolve my problem.
Full version of error:
events.js:174 throw er; // Unhandled 'error' event ^
Error: spawn node_modules/webpack/bin/webpack.js ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19) at onErrorNT (internal/child_process.js:415:16) at process._tickCallback (internal/process/next_tick.js:63:19) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) Emitted 'error' event at: at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12) at onErrorNT (internal/child_process.js:415:16) [... lines matching original stack trace ...] at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) 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! /home/alibek/.npm/_logs/2020-03-16T19_56_59_915Z-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.lal
I resolved this probled:
npm install webpack-cli
npm install
npm install --dev or npm install --only=dev
I am getting below error while running
'npm run dev'
command.
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --p
rogress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
npm ERR! node v6.11.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpa
ck.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/
webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch script 'cross-env NODE_ENV=development node_modul
es/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_module
s/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
--watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpac
k.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.
Can anybody tell me what is the issue here?
Thanks
I've had the same issue recently after upgrading Laravel app. You just need to install the package:
npm install cross-env
First you need to perform the following steps
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install --global cross-env
npm install
Then try restarting your terminal and make sure you are not using the integrated terminal (e.g on visual studio code) when running "npm run dev". Instead, try running the "npm run dev" command on a different powershell terminal window. Works for me everytime.