Failed to install npm dev / npm watch for Laravel 5.6 - node.js

I'm working on a project in Laravel 5.6, I've installed npm successfully, but when I run npm run dev or npm run watch, I get this error:
$ npm run dev
> # dev C:\wamp64\www\QuAn
> npm run development
> # development C:\wamp64\www\QuAn
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
11% building 9/14 modules 5 active ...elector.js?type=template&index=0!C:\wamp64\www\QuAn\resources\assets\js\components\ExampleComponent.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "babel" }.
78% module and chunk tree optimization unnamed compat pluginC:\wamp64\www\QuAn\node_modules\webpack\lib\Chunk.js:861
throw new Error(
^
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
at Chunk.get (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Chunk.js:861:9)
at C:\wamp64\www\QuAn\node_modules\←[4mextract-text-webpack-plugin←[24m\dist\index.js:176:48
at Array.forEach (<anonymous>)
at C:\wamp64\www\QuAn\node_modules\←[4mextract-text-webpack-plugin←[24m\dist\index.js:171:18
at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:12:1)
at AsyncSeriesHook.lazyCompileHook (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\Hook.js:154:20)
at Compilation.seal (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1342:27)
at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compiler.js:675:18
at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1261:4
at AsyncSeriesHook.eval [as callAsync] (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:31:1)
at AsyncSeriesHook.lazyCompileHook (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\Hook.js:154:20)
at Compilation.finish (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1253:28)
at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compiler.js:672:17
at eval (eval at create (C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\node_modules\←[4mtapable←[24m\lib\HookCodeFactory.js:33:10), <anonymous>:11:1)
at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1185:12
at C:\wamp64\www\QuAn\node_modules\←[4mwebpack←[24m\lib\Compilation.js:1097:9
←[90m at processTicksAndRejections (internal/process/task_queues.js:75:11)←[39m
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\INFO\AppData\Roaming\npm-cache\_logs\2019-09-20T21_53_25_570Z-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\INFO\AppData\Roaming\npm-cache\_logs\2019-09-20T21_53_25_604Z-debug.log
I've tried to clean the cache, delete node_modules, files and reinstall npm but nothing seems to resolve the problem.
Versions : Laravel 5.6 , Node 12.10 , npm 6.11.3

I think this solution will help you github Read JeffreyWay comment
Try doing a full reset:
rm -rf node_modules
rm package-lock.json yarn.lock
npm cache clear --force
npm install

Related

framework7 stuck at executing npm scripts and start npm throws a bunch of errors

i am new to the framework and was just going through a tutorial and encountered by an error after pressing create app in the local host
Generating package.json
✔ Creating required folders structure
✔ Installing NPM Dependencies
✔ Installing NPM Dev Dependencies
Executing NPM Scripts
this happens its stuck at executing NPM scripts waited a whole 3 hours still executing
The start npm command shows the following:-
> whatchat#1.0.0 start C:\Users\piyush\whatchat
> npm run dev
> whatchat#1.0.0 dev C:\Users\piyush\whatchat
> cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js
internal/modules/cjs/loader.js:1032
throw err;
^
Error: Cannot find module 'C:\Users\piyush\whatchat\build\webpack.config.js'
Require stack:
- C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js
- C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1029:15)
at Function.Module._load (internal/modules/cjs/loader.js:898:27)
at Module.require (internal/modules/cjs/loader.js:1089:19)
at require (internal/modules/cjs/helpers.js:73:18)
at WEBPACK_OPTIONS (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:114:13)
at requireConfig (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:116:6)
at C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:123:17
at Array.forEach (<anonymous>)
at module.exports (C:\Users\piyush\whatchat\node_modules\webpack-cli\bin\utils\convert-argv.js:121:15)
at Object.<anonymous> (C:\Users\piyush\whatchat\node_modules\webpack-dev-server\bin\webpack-dev-server.js:84:40) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-cli\\bin\\utils\\convert-argv.js',
'C:\\Users\\piyush\\whatchat\\node_modules\\webpack-dev-server\\bin\\webpack-dev-server.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_671Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! whatchat#1.0.0 start: `npm run dev`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the whatchat#1.0.0 start 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\piyush\AppData\Roaming\npm-cache\_logs\2020-12-15T14_13_28_828Z-debug.log
i searched lot on Google and discord coding help servers but could not fix this please help me out
you probably didn't install cordova before try:
npm install -g cordova

How to fix cross-env issue when running "npm run dev" for vue-cli

When I run npm run dev, I can not get the local IP properly.
Error: listen EFAULT: bad address in system call argument 0.0.0.0:8081
I do.
1. delete the "cross-env" folder and the "cross-spawn" folder under the node_modules
2. run npm install
3. run npm run dev
4. the error ip changes as follows.
Error: listen EFAULT: bad address in system call argument 10.0.75.1:8081
the ip address is vEthernet for the docker.
PS E:\WorkSpace\my-project> npm run dev
> my-project#1.0.0 dev E:\WorkSpace\my-project
> cross-env NODE_ENV=development webpack-dev-server --open --hot
E:\WorkSpace\my-project\node_modules\webpack-dev-server\bin\webpack-dev-server.js:356
if (err) throw err;
^
Error: listen EFAULT: bad address in system call argument 10.0.75.1:8081
at Server.setupListenHandle [as _listen2] (net.js:1279:14)
at listenInCluster (net.js:1327:12)
at doListen (net.js:1460:7)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:832:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-project#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-project#1.0.0 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\LG\AppData\Roaming\npm-cache\_logs\2019-06-11T13_23_46_070Z-debug.lo
What if you try this:
yarn remove webpack-dev-server
yarn add webpack-dev-server#2.9.1 --dev
yarn run dev
or using npm instead yarn

NPM start 'cannot find module'

When I try the command npm start the console runs npm install and returns this error:
> npm#6.4.1 prepare C:\Users\Aristophanes
> node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc
internal/modules/cjs/loader.js:589
throw err;
^
Error: Cannot find module 'C:\Users\Aristophanes\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
at startup (internal/bootstrap/node.js:308:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! npm#6.4.1 prepare: `node bin/npm-cli.js --no-audit --no-timing prune --prefix=. --no-global && rimraf test/*/*/node_modules && make -j4 doc`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the npm#6.4.1 prepare script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Full log: https://www.dropbox.com/s/de0369plkz8w2ir/2018-11-10T07_56_03_314Z-debug.log?dl=0
Can anyone explain the Cannot find module 'C:\Users\Aristophanes\bin\npm-cli.js' error? In the directory C:\Users\Aristophanes\bin\ I only have these files:
create-react-native-app
create-react-native-app.cmd
The npm-cli.js file it's looking for is actually located in C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
Does anyone have a suggestion to fix this? Thanks.

npm - How to fix error code ELIFECYCLE after updating #angular/cli

I have this error after updating #angular/cli both global and local to the latest version. I've tried cleaning cache, deleting node modules folder and reinstalling but the error still persists. Hope someone knows how to fix this.
Here is the full console log when I ran npm after updating:
PS D:\KIS\Name-Card-Frontend-Project> npm start
name-card-angular#0.0.0 start D:\KIS\Name-Card-Frontend-Project
ng serve --host 0.0.0.0 --proxy-config proxyconfig.json
trustedSubscriber._addParentTeardownLogic is not a function
TypeError: trustedSubscriber._addParentTeardownLogic is not a function
at MergeMapSubscriber.Subscriber [as constructor] (D:\KIS\Name-Card-Frontend-Project\node_modules\rxjs\internal\Subscriber.js:45:43)
at MergeMapSubscriber.OuterSubscriber [as constructor] (D:\KIS\Name-Card-Frontend-Project\node_modules\rxjs\internal\OuterSubscriber.js:20:42)
at new MergeMapSubscriber (D:\KIS\Name-Card-Frontend-Project\node_modules\rxjs\internal\operators\mergeMap.js:48:28)
at MergeMapOperator.call (D:\KIS\Name-Card-Frontend-Project\node_modules\rxjs\internal\operators\mergeMap.js:39:33)
at Observable.subscribe (D:\KIS\Name-Card-Frontend-Project\node_modules\rxjs\internal\Observable.js:24:22)
at D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\util\subscribeToObservable.js:10:20
at Object.subscribeToResult (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\util\subscribeToResult.js:7:45)
at MergeMapSubscriber._innerSub (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:75:38)
at MergeMapSubscriber._tryNext (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:72:14)
at MergeMapSubscriber._next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:55:18)
at MergeMapSubscriber.Subscriber.next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
at MapSubscriber._next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\map.js:52:26)
at MapSubscriber.Subscriber.next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
at TapSubscriber._next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\tap.js:62:26)
at TapSubscriber.Subscriber.next (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\Subscriber.js:64:18)
at MergeMapSubscriber.notifyNext (D:\KIS\Name-Card-Frontend-Project\node_modules\#angular\cli\node_modules\rxjs\internal\operators\mergeMap.js:84:26)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! name-card-angular#0.0.0 start: ng serve --host 0.0.0.0 --proxy-config proxyconfig.json
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the name-card-angular#0.0.0 start 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\Dell\AppData\Roaming\npm-cache_logs\2018-09-21T17_34_25_541Z-debug.log
UPDATE
The error disappeared after commenting the _addParentTeardownLogic function from the file at the link above. There're some times the code works fine when commenting error function of the modules. Really don't know why they added these functions just to be commented?

Laravel-mix - BrowserSync throwing an error at event.js:160

Not sure if the problem is related to laravel-mix, but I am having problem with Browsersync package. Here is my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
.browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
When I run npm run watch-poll ( watch doesn't pick up the changes, hence the watch-poll see here ) I get the following error on the console:
[Browsersync] Watching files...
events.js:160
throw er; // Unhandled 'error' event
^
Error: watch resources/views/auth/passwords ENOSPC
at exports._errnoException (util.js:1020:11)
at FSWatcher.start (fs.js:1443:19)
at Object.fs.watch (fs.js:1470:11)
at createFsWatchInstance (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:228:14)
at FSWatcher.NodeFsHandler._handleDir (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:407:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:455:19)
at FSWatcher.<anonymous> (/home/tanmay/LVProjects/learningdemo/node_modules/chokidar/lib/nodefs-handler.js:460:16)
at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch-poll"`
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! /home/tanmay/.npm/_logs/2017-08-07T07_02_31_677Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch-poll: `npm run watch -- --watch-poll`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch-poll 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/tanmay/.npm/_logs/2017-08-07T07_02_31_725Z-debug.log
I am on: Ubuntu 16.04.3 (Not a VM). Running: Nodejs v6.11.2, NPM v5.3.0
When I comment out the .browserSync() call from my mix.js:
mix.js('resources/assets/js/app.js', 'public/js')
// .browserSync({proxy: 'localhost:8000'})
.sass('resources/assets/sass/app.scss', 'public/css');
however, the error no longer persists. How do I get around the problem? Please feel free to ask any other necessary information.
Here is my package.json file
UPDATE: This error doesn't occur on a new laravel project. To get the same result as a new project, this is what I did:
I removed the node modules: rm -rf node_modules I removed the package-lock.json file: rm package-lock.json I re-run: npm install, npm run dev, npm run watch-poll
Result: still same error :(
This might be due to another task running on port 4040 already.
You can try killall -9 node
Source/more details: https://github.com/parse-community/parse-dashboard/issues/401#issuecomment-224007436
I suspect it's the same problem that is shown & with working solution from Gulp Error: watch ENOSPC
Try this: Why this issue occured? There is the limit in the number of
files that can be watched in a system. We have to increase this
number. The below command can be used to increase this number.
$ echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Resources