Reputation: 45
When I installed karma in nodejs modules, in my log written this:
npm http 304 https registry.npmjs.org/proto-list
> [email protected] install C:\Users\<user>\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs
> node install.js
Downloading http://phantomjs.googlecode.com/files/phantomjs-1.9.1-windows.zip
Saving to \tmp\phantomjs\phantomjs-1.9.1-windows.zip
Receiving...
C:\Users\<user>\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\install.js:215
deferred.reject('Error with http request: ' + util.inspect(response.head
^
ReferenceError: util is not defined
at ClientRequest.<anonymous> (C:\Users\<user>\AppData\Roaming\npm\node_modules\karma-phantomjs-launcher\node_modules\phantomjs\install.js:215:53)
at ClientRequest.g (events.js:175:14)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1669:21)
at HTTPParser.parserOnHeadersComplete [as onHeadersComplete] (http.js:120:23)
at Socket.socketOnData [as ondata] (http.js:1564:20)
at TCP.onread (net.js:525:27)
npm ERR! weird error 8
npm ERR! not ok code 0
d:\nodejs>npm install util
npm http 304 https registry.npmjs.org/events.node
[email protected] node_modules\util
└── [email protected]
module util already installed. Why karma not installing?
Upvotes: 3
Views: 1977
Reputation:
Here's what worked for me-
The phantomJSZip is downloaded (at least it tries to) in
C:\tmp\phantomjs
But the file size is 0kb. So I downloaded one from PhantomJS website and copied to that location.
All credit goes to the two answers before me. I just did a search for the zip file.
Upvotes: 0
Reputation: 45
I downloaded fantomjs zip, and replaced it in TMPDIR
.
After that, again launched installing karma.
And this happened.
But when I launched nodejs from tutorial script, I took error...
But that other story...
Upvotes: 1
Reputation: 839
I had a similar error (on Linux though). The thing is this:
PhantomJS comes with it's own "installer" install.js
that is fetching the precompiled PhantomJS binaries to a temporary directory and unzips them to somewhere inside your node_modules
directory.
I had to export the TMPDIR
variable because /tmp
was not writable. In your case it looks like the \tmp
fallback doesn't cut it (it's Windows after all).
Try setting TMPDIR
to point to an existing directory and run npm install
again.
Good luck!
PS: Can anyone extend this answer with instructions on how to set environment variables on Windows?
Upvotes: 2