I left my development machine on overnight with the express server running and when I woke up I noticed the express server had crashed with the following error:
C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\WorkQueue.js:72
throw new Error('Queue is empty');
^
Error: Queue is empty
The error is coming from the xdevapi module but I can't seem to find anything on queues in the docs or why this error is happening.
Any advice?
Edit: Here's the entire log for the error:
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\James\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'start:express' ]
2 info using npm#6.4.0
3 info using node#v10.8.0
4 verbose run-script [ 'prestart:express', 'start:express', 'poststart:express' ]
5 info lifecycle server#1.0.0~prestart:express: server#1.0.0
6 info lifecycle server#1.0.0~start:express: server#1.0.0
7 verbose lifecycle server#1.0.0~start:express: unsafe-perm in lifecycle true
8 verbose lifecycle server#1.0.0~start:express: PATH: C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\James\Projects\nine-tails\server\node_modules\.bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\James\bin;C:\Python37\Scripts;C:\Python37;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\PuTTY;C:\metasploit-framework\bin;C:\tools\php72;C:\Users\James\AppData\Local\Microsoft\WindowsApps;C:\Users\James\AppData\Roaming\npm;C:\Program Files\Docker Toolbox;C:\Users\James\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\James\AppData\Local\GitHubDesktop\bin
9 verbose lifecycle server#1.0.0~start:express: CWD: C:\Users\James\Projects\nine-tails\server
10 silly lifecycle server#1.0.0~start:express: Args: [ '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development DEBUG=express,database,routes node server.js' ]
11 silly lifecycle server#1.0.0~start:express: Returned: code: 1 signal: null
12 info lifecycle server#1.0.0~start:express: Failed to exec start:express script
13 verbose stack Error: server#1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\James\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:249:5)
14 verbose pkgid server#1.0.0
15 verbose cwd C:\Users\James\Projects\nine-tails\server
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\James\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "start:express"
18 verbose node v10.8.0
19 verbose npm v6.4.0
20 error code ELIFECYCLE
21 error errno 1
22 error server#1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
22 error Exit status 1
23 error Failed at the server#1.0.0 start:express script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
and
C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\WorkQueue.js:72
throw new Error('Queue is empty');
^
Error: Queue is empty
at WorkQueue.process (C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\WorkQueue.js:72:15)
at Client.handleServerMessage (C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\Protocol\Client.js:201:21)
at Client.handleNetworkFragment (C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\Protocol\Client.js:245:14)
at TLSSocket.stream.on.data (C:\Users\James\Projects\nine-tails\server\node_modules\#mysql\xdevapi\lib\Protocol\Client.js:65:36)
at TLSSocket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at TLSSocket.Readable.push (_stream_readable.js:219:10)
at TLSWrap.onread (net.js:639:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server#1.0.0 start:express: `cross-env NODE_ENV=development DEBUG=express,database,routes node server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server#1.0.0 start:express 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\James\AppData\Roaming\npm-cache\_logs\2018-09-05T09_06_40_255Z-debug.log
Shouldn't be happening, unless the X Plugin (MySQL server) is sending some out-of-band or unexpected message (which would be pretty weird).
Anyway, that's not a lot to work with. Maybe you can extend your logging infrastructure (or mess a bit with the response handlers in the connector) too see what's actually happening.
If you find something interesting, I suggest you create a bug report in the official MySQL issue tracker using the Connector for Node.js category.
Disclaimer: I'm the project lead dev.
Related
Im trying to run npm install on ng2-smart-table. It looks like its having trouble getting some of the modules. Im getting the following error.
npm ERR! Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tommie/.npm/_logs/2018-05-15T14_32_04_066Z-debug.log
Tommies-MacBook-Pro:ng2-smart-table tommie$ vi /Users/tommie/.npm/_logs/2018-05-15T14_32_04_066Z-debug.log
Tommies-MacBook-Pro:ng2-smart-table tommie$ rm package-lock.json
rm: package-lock.json: No such file or directory
When I look at the log I get the following
<snip>
4508 silly pacote range manifest for http-proxy-middleware#~0.17.4 fetched in 16ms
4509 silly resolveWithNewModule http-proxy-middleware#0.17.4 checking installable status
4510 silly pacote version manifest for sockjs#0.3.18 fetched in 16ms
4511 silly resolveWithNewModule sockjs#0.3.18 checking installable status
4512 silly pacote version manifest for sockjs-client#1.1.2 fetched in 17ms
4513 silly resolveWithNewModule sockjs-client#1.1.2 checking installable status
4514 silly pacote range manifest for yargs#^6.0.0 fetched in 3ms
4515 silly resolveWithNewModule yargs#6.6.0 checking installable status
4516 http fetch GET 304 https://registry.npmjs.org/spdy 33ms (from cache)
4517 silly fetchPackageMetaData error for spdy#^3.4.1 Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4518 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4518 verbose stack at JSON.parse (<anonymous>)
4518 verbose stack at parseJson (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/node_modules/json-parse-better-errors/index.js:7:17)
4518 verbose stack at consumeBody.call.then.buffer (/usr/local/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:96:50)
4518 verbose stack at <anonymous>
4518 verbose stack at process._tickCallback (internal/process/next_tick.js:188:7)
4519 verbose cwd /Users/tommie/dev/ng2-smart-table
4520 verbose Darwin 15.6.0
4521 verbose argv "/usr/local/Cellar/node/8.2.1/bin/node" "/usr/local/bin/npm" "install"
4522 verbose node v8.2.1
4523 verbose npm v5.4.0
4524 error Unexpected end of JSON input while parsing near '..."spdy","version":"1.1'
4525 verbose exit [ 1, true ]
Any suggestions would be appreciated.
I got the same error and on searching I found out I needed to clear the npm cache first, did and it worked.
first run the following command:
npm cache clean --force
And then run that react-native command, it will work hopefully.
I am testing NetLify CMS for a project, but I am not able to work in my local environment, because gulp server crashs before it start, due to the error below:
$ npm start
> victor-hugo#1.0.0 start C:\Users\maufa\Documents\web-development\kaldi-hugo-cms-template
> gulp server
[14:17:07] Requiring external module babel-register
[14:17:08] Using gulpfile ~\Documents\web-development\kaldi-hugo-cms-template\gulpfile.babel.js
[14:17:08] Starting 'hugo'...
[14:17:08] Starting 'css'...
[14:17:09] Starting 'js'...
[14:17:09] Starting 'svg'...
[14:17:09] Starting 'cms'...
[14:17:09] Finished 'cms' after 150 ms
events.js:160
throw er; // Unhandled 'error' event
^
Error: spawn ./bin/hugo.win32 ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:394:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:509:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! victor-hugo#1.0.0 start: `gulp server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the victor-hugo#1.0.0 start script 'gulp server'.
So, looks like it is trying to find hugo.win32 inside the bin folder.
However, inside this folder I ave:
hugo.darwin
hugo.exe
hugo.linux
Any clue?
It looks like this issue is particular to the Kaldi Hugo template. I installed on Windows and got the same error, then I tried renaming hugo.exe to hugo.win32, and it worked. I found the error in gulpfile.babel.js (incorrect string identifier for Windows), and submitted a PR. If you don't want to wait for the merge, feel free to change your version directly: https://github.com/netlify-templates/kaldi-hugo-cms-template/pull/3/files
I just downloaded node.js and I'm trying to install a couple of dependencies from package.json, and I keep getting the same error. I tryied the latest version and the LTS, and both gave the same error.
package.json
{
"name": "snake-ch3",
"dependencies": {
"express": "*",
"express-generator": "*"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-browserify": "~3.4.0",
"grunt-contrib-uglify": "~0.8.0",
"grunt-contrib-watch": "~0.6.1"
}
}
and error:
0 info it worked if it ends with ok
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 'install' ]
2 info using npm#2.15.9
3 info using node#v4.6.0
4 verbose readDependencies loading dependencies from C:\Users\Julian\Desktop\node\ch3\package.json
5 error install Couldn't read dependencies
6 verbose stack Error: Failed to parse json
6 verbose stack No data, empty input at 1:1
6 verbose stack
6 verbose stack ^
6 verbose stack at parseError (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:390:11)
6 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:79:23)
6 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\read-package-json\read-json.js:48:5
6 verbose stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\graceful-fs.js:78:16
6 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (fs.js:380:3)
7 verbose cwd C:\Users\Julian\Desktop\node\ch3
8 error Windows_NT 10.0.14393
9 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
10 error node v4.6.0
11 error npm v2.15.9
12 error file C:\Users\Julian\Desktop\node\ch3\package.json
13 error code EJSONPARSE
14 error Failed to parse json
14 error No data, empty input at 1:1
14 error
14 error ^
15 error File: C:\Users\Julian\Desktop\node\ch3\package.json
16 error Failed to parse package.json data.
16 error package.json must be actual JSON, not just JavaScript.
16 error
16 error This is not a bug in npm.
16 error Tell the package author to fix their package.json file. JSON.parse
17 verbose exit [ 1, true ]
I validated the json on https://jsonformatter.curiousconcept.com/ and looked for json parsing errors related to "Windows_NT 10.0.14393" and I'm not getting anything.
I reinstalled node a couple of times so it's not node, or a dowloading problem. Can anyone tell me if I'm doing anything wrong?
EDIT
I just tryied running npm init with all of the default values and then editing it so it has the "dependencies" and "devDependencies" and it works all of a sudden. I tryied doing it again the way I did it before, and I got the same error.
now it looks like this:
package.json
{
"name": "snake-game",
"version": "1.0.0",
"description": "a simple snake game",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Julian Avar",
"dependencies": {
"express": "*",
"express-generator": "*"
},
"devDependencies": {
"grunt": "~0.4.5",
"grunt-browserify": "~3.4.0",
"grunt-contrib-uglify": "~0.8.0",
"grunt-contrib-watch": "~0.6.1"
}
}
I've noticed that files made in many Windows programs will often prepend the text with bytes in a way that will prevent Unix based programs from reading them correctly (esp if the Unix program is expecting a structure like a JSON file). From #robertklep's comment, I assume it's a Byte Order Mark, but I've never known the name for it before now.
The recommended way to make a package.json to avoid this kind of thing is to run npm init from your command line, to both avoid OS wonkiness and also to make sure you have a minimally valid package.json when all is said and done.
I just did a npm update and got some new package versions. This broke my build, leaving me unable to use the default updateSchema.js from https://github.com/relayjs/relay-starter-kit/blob/master/scripts/updateSchema.js.
If anyone has already dealt with this issue, it would be greatly appreciated if you could share your solution.
I am aware that some options were removed in the new Babel 6 version (https://gist.github.com/hzoo/7e78b12d99e326f2e04f). The npm-debug.log file looks like this:
0 info it worked if it ends with ok
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 'update' ]
2 info using npm#2.14.12
3 info using node#v4.2.4
4 verbose run-script [ 'preupdate', 'update', 'postupdate' ]
5 info preupdate bifrost#1.0.0
6 info update bifrost#1.0.0
7 verbose unsafe-perm in lifecycle true
8 info bifrost#1.0.0 Failed to exec update script
9 verbose stack Error: bifrost#1.0.0 update: `babel-node ./scripts/helpers/updateSchema.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\lifecycle.js:214:16)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at EventEmitter.emit (events.js:172:7)
9 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\lib\utils\spawn.js:24:14)
9 verbose stack at emitTwo (events.js:87:13)
9 verbose stack at ChildProcess.emit (events.js:172:7)
9 verbose stack at maybeClose (internal/child_process.js:818:16)
9 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
10 verbose pkgid bifrost#1.0.0
11 verbose cwd C:\bifrostApp
12 error Windows_NT 10.0.10586
13 error argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "update"
14 error node v4.2.4
15 error npm v2.14.12
16 error code ELIFECYCLE
17 error bifrost#1.0.0 update: `babel-node ./scripts/helpers/updateSchema.js`
17 error Exit status 1
18 error Failed at the bifrost#1.0.0 update script 'babel-node ./scripts/helpers/updateSchema.js'.
18 error This is most likely a problem with the bifrost package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error babel-node ./scripts/helpers/updateSchema.js
18 error You can get their info via:
18 error npm owner ls bifrost
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]
The commandline error looks like this:
ReferenceError: [BABEL] C:\bifrostApp\scripts\helpers\updateSchema.js: Unknown option: base.Children. Check out http://babeljs.io/docs/usage/options/ for more info
at Logger.error (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\logger.js:39:11)
at OptionManager.mergeOptions (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:267:20)
at OptionManager.init (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\options\option-manager.js:465:10)
at File.initOptions (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\index.js:194:75)
at new File (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\file\index.js:123:22)
at Pipeline.transform (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\transformation\pipeline.js:45:16)
at Object.transformFileSync (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-core\lib\api\node.js:124:10)
at compile (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:98:20)
at loader (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:126:14)
at Object.require.extensions.(anonymous function) [as .js] (C:\bifrostApp\node_modules\babel-cli\node_modules\babel-register\lib\node.js:136:7)
Make sure the presets listed in your .babelrc file are installed in your node_modules folder.
For example, if you have the following in your .babelrc file:
{
"presets": ["react", "es2015"]
}
You will need "babel-preset-es2015" and "babel-preset-react" installed with npm install --save.
I upgraded from npm 2 -> npm 3, and downgraded babel-core to 6.5.2, this made it work.
I am new to learning node.js and copying and pasting the details of the npm-debug.txt file here:
How do I best describe this error and how can I fix it?
0 info it worked if it ends with ok
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 'init' ]
2 info using npm#1.3.11
3 info using node#v0.10.20
4 verbose node symlink C:\Program Files\nodejs\\node.exe
5 silly package data undefined
6 info init written successfully
7 error Error: canceled
7 error at Interface.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\read\lib\read.js:66:13)
7 error at Interface.EventEmitter.emit (events.js:92:17)
7 error at Interface._ttyWrite (readline.js:620:16)
7 error at ReadStream.onkeypress (readline.js:99:10)
7 error at ReadStream.EventEmitter.emit (events.js:98:17)
7 error at emitKey (readline.js:1095:12)
7 error at ReadStream.onData (readline.js:840:14)
7 error at ReadStream.EventEmitter.emit (events.js:95:17)
7 error at ReadStream.<anonymous> (_stream_readable.js:746:14)
7 error at ReadStream.EventEmitter.emit (events.js:92:17)
8 error If you need help, you may report this log at:
8 error <http://github.com/isaacs/npm/issues>
8 error or email it to:
8 error <npm-#googlegroups.com>
9 error System Windows_NT 6.1.7601
10 error command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "init"
11 error cwd C:\web-design\node.js\node_modules
12 error node -v v0.10.20
13 error npm -v 1.3.11
14 verbose exit [ 1, true ]
It looks that there is a bug on your code. Check that out.