check invalid js syntax in a whole project for EC6 - javascript

IN my gulp tasks, I ran into this exception
events.js:72
throw er; // Unhandled 'error' event
^
Error: StringMap expected string key
And I found there is an syntax invalid problem in a script of my project
function(date, LoanRate=0, duration=undefined){
This syntax works on web browser, but failed in Gulp gulp-ng-annotate task.
However, there are hundreds of js files in my project.
Is there any tool or command can find the invalid syntax?

Related

How to fix this error while running a discord bot?

Debugger attached.
Waiting for the debugger to disconnect...
internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'node:events'
I am using discord.js and node.js on Visual Studio Code
To fix this issue, you need to update your nodejs to v16.6 or higher version from here,
Download

meteor fails to start server in events.js with write EOF exception

When I try to start a meteor project I always get this error message (on my machine only, the project is working fine on my colleague's machines):
=> Started proxy.
=> Started MongoDB.
events.js:141
throw er; // Unhandled 'error' event
^
Error: write EOF
at exports._errnoException (util.js:907:11)
at WriteWrap.afterWrite (net.js:785:14)
Sometimes the error already shows up before mongo is stared.
In fact, I cannot start any project anymore ... :-(
It seems that I have a serious problem with my meteor installation.
I tried re-installing meteor, but no effect.
meteor reset --> no effect
Could it be a problem with a downloaded package? Where does meteor store the packages?
I really would appreaiate any hint what I can try to make it work again.
I'm using meteor on windows.

Javascript error event using meteor starter files

I'm building an app that uses the Meteor starter files and sometimes get this error which I think is related to Node.js:
the error is:
events.js:72
throw er; // Unhandled 'error' event
Error: write EOF
at errnoException (net.js:905:11)
at Object.afterWrite (net.js:721:19)
I wanted to check if anyone has ever come across it before and if you have and recommendations on how to fix it?
Any assistance would be appreciated.
Thank you.

Gulp / Laravel Elixir - Deleting a local variable in strict mode error

I am working on a Laravel 5 project on a Windows machine and just encountered an error while attempting to run gulp-
events.js:85
throw er; // Unhandled 'error' event
^
SyntaxError: c:/Users/Benjamin/PhpstormProjects/essex-youth-footbal/resources/assets/bower/jquery/dist/vendor.js: Deleting local variable in strict mode (13795:23316)
13793 | //
Here is the entry in the gulpfile.js where this is being thrown:
mix.scripts([
'/assets/bower/jquery/dist/jquery.min.js',
'/assets/bower/bootstrap/dist/js/bootstrap.js',
'/assets/js/main.js',
'/assets/bower/bootbox/bootbox.js',
'/assets/bower/vue/dist/vue.min.js',
'/assets/bower/mustache/mustache.min.js',
'/assets/bower/bootstrap-multiselect/dist/js/bootstrap-multiselect.js',
'/assets/js/redactor.js',
'/assets/js/vendor/redactor/fontcolor.js',
'/assets/js/vendor/redactor/fontsize.js',
'/assets/js/vendor/redactor/imagemanager.js',
'/assets/js/vendor/redactor/video.js',
'/assets/bower/remarkable-bootstrap-notify/dist/bootstrap-notify.min.js',
'/assets/bower/jquery.maskedinput/dist/jquery.maskedinput.min.js',
'/assets/bower/moment/min/moment.min.js',
'/assets/bower/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js',
'/assets/bower/raphael/raphael-min.js',
'/assets/bower/morrisjs/morris.min.js'
], 'public/js/vendor.js', 'resources');
I also noticed that any merged JS files that ARE created have "use strict" prepended to the code.
gulp is working fine in another project on the same computer and this project's gulp configuration works fine on another computer. Any ideas what might be causing this?

Repeated errors will cause Forever to stop restarting node.js app

I am running a node.js server as a backend for a client side Javascript application and we are using Forever to launch the node.js app.
A bug has been discovered in the client code that provides an incorrect path when trying to open a file (because of case insensitivity in our current server). The error is not properly handled and this causes node.js crash. The first few times this occurs Forever sucessfully relaunched the app but after repeatedly triggering the error Forever will fail to bring the app back up and we get a 502 bad gateway error when trying to goto any of the server pages.
Here is the unhandled error:
Error: ENOENT, no such file or directory 'public/projects/testHoc7/hocProject121/agents/agent1/index.agent'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.writeFileSync (fs.js:971:15)
at Object.editAgentXML [as edit_agent_XML] (/srv/AgentCubesOnline/project.js:699:5)
at /srv/AgentCubesOnline/project.js:313:30
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/collection/query.js:159:5
at Cursor.nextObject (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/cursor.js:742:5)
at commandHandler (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/cursor.js:716:14)
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/db.js:1847:9
at Server.Base._callHandler (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/connection/base.js:445:41)
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/connection/server.js:478:18
error: Forever detected script exited with code: 8
error: Script restart attempt #8
/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/connection/base.js:245
throw message;
and here is the log message we get when Forever fails to restart the app:
Error: ENOENT, no such file or directory 'public/projects/testHoc7/hocProject121/agents/agent1/index.agent'
at Object.fs.openSync (fs.js:432:18)
at Object.fs.writeFileSync (fs.js:971:15)
at Object.editAgentXML [as edit_agent_XML] (/srv/AgentCubesOnline/project.js:699:5)
at /srv/AgentCubesOnline/project.js:313:30
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/collection/query.js:159:5
at Cursor.nextObject (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/cursor.js:742:5)
at commandHandler (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/cursor.js:716:14)
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/db.js:1847:9
at Server.Base._callHandler (/srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/connection/base.js:445:41)
at /srv/AgentCubesOnline/node_modules/mongodb/lib/mongodb/connection/server.js:478:18
error: Forever detected script exited with code: 8
/usr/lib/node_modules/forever/node_modules/forever-monitor/node_modules/broadway/node_modules/eventemitter2/lib/eventemitter2.js:283
throw arguments[1]; // Unhandled 'error' event
^
Error: Cannot stop process that is not running.
at /usr/lib/node_modules/forever/node_modules/forever-monitor/lib/forever-monitor/monitor.js:332:26
at process._tickCallback (node.js:419:13)
We will of course fix the bug and add proper error handling but I am currently more interested in finding out how to prevent Forever from failing. What could cause Forever to stop bringing node.js back?

Categories

Resources