Launching a local host environment with vuepress gives a res.getHeader Typeerror - vuepress

Im installing vuepress using the documentation I find here:
This all works fine. However when I run:
vuepress dev
And go to my localhost:8080 I receive the following error:
VuePress dev server listening at http://localhost:8080/
(node:44843) UnhandledPromiseRejectionWarning: TypeError: res.getHeader is not a function
at processRequest (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:82:18)
at ready (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:51:12)
at handleRequest (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/util.js:167:5)
at Promise (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:44:7)
at new Promise (<anonymous>)
at middleware (/usr/local/lib/node_modules/vuepress/node_modules/webpack-dev-middleware/lib/middleware.js:43:12)
at Promise.all.Promise (/usr/local/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:43:7)
at new Promise (<anonymous>)
at /usr/local/lib/node_modules/vuepress/node_modules/koa-webpack/index.js:42:5
at dispatch (/usr/local/lib/node_modules/vuepress/node_modules/koa/node_modules/koa-compose/index.js:42:32)
at /usr/local/lib/node_modules/vuepress/node_modules/#shellscape/koa-static/legacy/index.js:58:19
at Generator.throw (<anonymous>)
at step (/usr/local/lib/node_modules/vuepress/node_modules/#shellscape/koa-static/legacy/index.js:6:221)
at _throw (/usr/local/lib/node_modules/vuepress/node_modules/#shellscape/koa-static/legacy/index.js:6:455)
(node:44843) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44843) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I tried installing:
npm install webpack-dev-middleware#3.6.0
But did does not solve my problem. Any ideas on what I can do next?

Try removing vuepress and install it again (globally).
sudo npm remove vuepress -g or npm remove vuepress
Then:
sudo npm install vuepress -g

Related

'ENOTDIR' error while running relay-compiler with yarn

I am trying to make an application with react-relay following the step-by-step guide on the relay documentation. After running yarn install and adding the yarn relay script which runs "relay-compiler --src ./src --schema ./schema.graphql --language typescript". And I was getting an ENOTDIR error as below:
$ relay-compiler --src ./src --schema ./schema.graphql --language typescript
Error: spawn ENOTDIR
at ChildProcess.spawn (node:internal/child_process:412:11)
at Object.spawn (node:child_process:698:9)
at /home/Documents/workspace/react-relay/node_modules/relay-compiler/bin/relay-compiler:1841:31
at new Promise (<anonymous>)
at Function.isAvailable (/home/Documents/workspace/react-relay/node_modules/relay-compiler/bin/relay-compiler:1835:12)
at /home/Documents/workspace/relay-test/node_modules/relay-compiler/bin/relay-compiler:8221:61
at Generator.next (<anonymous>)
at asyncGeneratorStep (/home/Documents/workspace/react-relay/node_modules/#babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/home/Documents/workspace/react-relay/node_modules/#babel/runtime/helpers/asyncToGenerator.js:25:9)
at /home/Documents/workspace/react-relay/node_modules/#babel/runtime/helpers/asyncToGenerator.js:32:7
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I have then updated my versions of node, npm, yarn. And tried cloning some relay example projects from github, and I was getting the same error message with all repos that uses relay.
Turned out it was because I don't have the required watchman package, this was resolved by installing Watchman on my machine.

Nativescript angular new project creating error

I installed all the environment setups for nativescript angular but I can't create new project using tns create command when I tried it shows me a error like this can anyone pls help me to solve to error
While trying I got this below error
npm WARN deprecated request#2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents#1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm ERR! Unexpected end of JSON input while parsing near '...":"latest","#types/gu'

Cannot run addon after installation of web-ext on ubuntu 16.04 nodejs v4.2.6 npm 3.5.2

when installing web-ext i got this two messages in the and of installation:
npm WARN optional Skipping failed optional dependency /web-ext/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.2.4
after trying to start addon with web-ext run i get this messages
TypeError: Cannot read property 'R_OK' of undefined
at fileIsReadable (/usr/local/lib/node_modules/web-ext/dist/webpack:/src/util/file-exists.js:24:42)
at _callee$ (/usr/local/lib/node_modules/web-ext/dist/webpack:/src/util/file-exists.js:28:11)
at tryCatch (/usr/local/lib/node_modules/web-ext/node_modules/regenerator-runtime/runtime.js:62:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/web-ext/node_modules/regenerator-runtime/runtime.js:296:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next]
(/usr/local/lib/node_modules/web-ext/node_modules/regenerator-runtime/runtime.js:114:21)
at step (/usr/local/lib/node_modules/web-ext/dist/webpack:/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:1)
at /usr/local/lib/node_modules/web-ext/dist/webpack:/node_modules/babel-runtime/helpers/asyncToGenerator.js:35:1
at new Promise (/usr/local/lib/node_modules/web-ext/dist/webpack:/node_modules/core-js/library/modules/es6.promise.js:177:1)
at /usr/local/lib/node_modules/web-ext/dist/webpack:/node_modules/babel-runtime/helpers/asyncToGenerator.js:14:1
at fileExists (/usr/local/lib/node_modules/web-ext/dist/web-ext.js:13002:17)
Update to at least the latest v6 of node. I recommend you to use >= v8, because the support for v6 is ending in 2019 and you can't use async/await for example. (https://github.com/nodejs/Release#release-schedule)

Why am I getting errors running the coffee command in cygwin?

I followed the CoffeeScript installation guide by installing Node.js with the node-v0.10.9-x64.msi installer. I then started up a cygwin console and cd'd into the directory with my .coffee file. If I type coffee all by itself, it gives me this error:
$ coffee
coffee>
events.js:72
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at errnoException (net.js:884:11)
at Socket._read (net.js:389:21)
at Socket.Readable.read (_stream_readable.js:320:10)
at Socket.read (net.js:291:43)
at new Socket (net.js:185:10)
at process.stdin (node.js:660:19)
at new REPLServer (repl.js:132:15)
at Object.exports.start (repl.js:312:14)
at Object.module.exports.start (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\repl.js:106:23)
at Object.exports.run (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:77:32)
at Object.<anonymous> (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\bin\coffee:7:41)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3
And if I run the command with -lw it gives me this error:
$ coffee -lw Example.js.coffee
Error: This socket is closed.
at Socket._write (net.js:618:19)
at doWrite (_stream_writable.js:219:10)
at writeOrBuffer (_stream_writable.js:209:5)
at Socket.Writable.write (_stream_writable.js:180:11)
at Socket.write (net.js:596:40)
at lint (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:468:15)
at compileScript (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:193:18)
at C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:144:18
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
And if I run with just the -l option it gives me this error:
$ coffee -l Example.coffee
Error: This socket is closed.
at Socket._write (net.js:618:19)
at doWrite (_stream_writable.js:219:10)
at writeOrBuffer (_stream_writable.js:209:5)
at Socket.Writable.write (_stream_writable.js:180:11)
at Socket.write (net.js:596:40)
at lint (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:468:15)
at compileScript (C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:193:18)
at C:\Users\foo\AppData\Roaming\npm\node_modules\coffee-script\lib\coffee-script\command.js:144:18
at fs.js:266:14
at Object.oncomplete (fs.js:107:15)
But it seems like I can compile and/or watch option without the lint option and things work as expected.
I don't know anything about Node.js. I've tried googling these errors and I see similar ones related to ports in use and socket issues. I think it might be useful to note that I'm using Intellij IDEA (an IDE) and it has a CoffeeScript plugin which perhaps is interfering. But when I turn Intellij off I still get these same errors so that might be a red herring.
Also, perhaps there's a specific cygwin version of node.js I should have installed instead of the one I got from the installation instructions?
If I type node all by itself, it says this:
$ node
events.js:72
throw er; // Unhandled 'error' event
^
Error: read ENOTCONN
at errnoException (net.js:884:11)
at Socket._read (net.js:389:21)
at Socket.Readable.read (_stream_readable.js:320:10)
at Socket.read (net.js:291:43)
at new Socket (net.js:185:10)
at process.stdin (node.js:660:19)
at startup (node.js:145:16)
at node.js:901:3
Unfortunately, node no longer supports Cygwin.
One workaround is to use some variety of MSysGit as a console instead of Cygwin, at least for running node/coffeescript. Git Bash supplies a good one. You can get it here.

Working with compound js on windows. Cannot start anything

I wish to create a hello world application using compound.js.
So far, nothing works at all.
I've installed "npm install compound -g" to have compound be available globally.
Now I wish to run "compound init" and I get this:
(see first code block)
While googling, I found an example app on npm called mongoose-compound-example-app.
After npm installing that, I ran "node ." as suggested in the readme:
(see second code block)
I am using Windows 8 x64. Node itself works, and I've been able to run a "hello world" application using locomotive.js. I really want to get compound figured out and working, but I can't seem to get anywhere at all.
Thank you in advance!
EDIT:
I am using Node v0.10.0
C:\Users\Lev\test>compound init hello
path.js:204
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at f (path.js:204:15)
at Object.filter (native)
at Object.exports.join (path.js:209:40)
at CompoundServer.module.exports [as extensions] (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\server\extensions.js:13:25)
at CompoundServer.initCompound (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\compound.js:100:14)
at CompoundServer.init (C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\server\compound.js:42:29)
at C:\Users\Lev\AppData\Roaming\npm\node_modules\compound\lib\compound.js:61:18
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:903:3
mongoose-compound-example-app error:
C:\Projects\mongoose-compound-example-app\config\environment.js:11
app.use(compound.assetsCompiler.init());
^
TypeError: Cannot call method 'init' of undefined
at Function.<anonymous> (C:\Projects\mongoose-compound-example-app\config\environment.js:11:41)
at Function.app.configure (C:\Projects\mongoose-compound-example-app\node_modules\express\lib\application.js:396:61)
at module.exports (C:\Projects\mongoose-compound-example-app\config\environment.js:10:9)
at evalInContextOf (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:187:9)
at requireIfExists (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:165:9)
at configureApp (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:147:5)
at CompoundServer.initCompound (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:91:9)
at CompoundServer.init (C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\server\compound.js:42:29)
at C:\Projects\mongoose-compound-example-app\node_modules\compound\lib\compound.js:61:18
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)
at node.js:903:3
As discussed in the chat, there seems to be a problem or conflict with the version of Node.js you are using.
Compound's package.json says that it expects Node.js 0.8.0 or higher. You mentioned that it works in 0.9, but not in 0.10. This is likely a bug, as the odd-numbered versions of Node are typically the unstable versions before the later even number stable releases.
I recommend posting a reproducible example on the bug tracker for Compound, and possibly Node.js if you can narrow it down to a Node issue.

Resources