When I'm trying using yeoman web generator, although it's working, but looking through the whole generate progress, it always gives me some errors below, no matter what generator I used, they are always there.
npm ERR! phantomjs@1.9.7-6 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs@1.9.7-6 install script.
npm ERR! This is most likely a problem with the phantomjs package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node install.js
npm ERR! You can get their info via:
npm ERR! npm owner ls phantomjs
npm ERR! There is likely additional logging output above.
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Applications/MAMP/htdocs/DECO3800/test
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.10
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Applications/MAMP/htdocs/DECO3800/test/npm-debug.log
npm ERR! not ok code 0
Just wondering why it would be like that, and how to solve it or it totally no affect to my built web project?
The workaround mentioned is:
You can download the phantomjs zip manually here: https://bitbucket.org/ariya/phantomjs/downloads and move it to the dir npm wants to download it to.
Whenever you try to build your project the next time, phantomjs is already present and doesn't have to be downloaded, so the download will be skipped and your project will finish (unless another error is encountered).
There seems to be a problem with the Bitbucket CDN at the moment.
You can use this as a temporary workaround:
Got a similar problem using the following setup:
Of less importance:
Error:
At first I thought I solved it with the fix I posted on github HERE. On this github issue post you can also find other possible solutions.
But when I tried to generate a new project a few weeks later, I ran into the same issue...
My generator executes the following install commands:
I also tried the phantomjs troubleshooting and none of them solved my problem.
Then when I tried to install phantomjs in an empty folder using the npm install command in gitbash and it installed without any error repeatedly.
When I did this with grunt-lib-phantomjs, it got the same error 3 times out of 10.
And when I did this with grunt-html-snapshot, it got the same error 10 times out of 10.
This got me thinking. I installed phantomjs with npm on a new folder and ran my generator. This resulted in an installation without errors 10 out of 10.
To let the generator handel the complete installation I added the installation of phantomjs under the conflicts method priority of the generator to be shure it got installed before the installation of the other npm installs.
This fixed my problem completely, hope it is helpful for someone else to.
P.S.:
If you use any kind of versioning control that leaves out the installed node_modules for the deployed project. You might consider using the following in your end method priority of your generator.
This combo will result in a deduplicated installation with fixed versions on the main and dependency levels.
This will also keep the jsphantom install on the main level and not as a dependency to avoid the error discussed. And thus will result in a clean install when you downloaded a versioned project without the node_modules folder using:
I have the same problem and I have come across this thread where someone claims he found a workaround to a similar problem: https://github.com/Medium/phantomjs/issues/161
"Same here, got it working by downloading from https://bitbucket.org/ariya/phantomjs/downloads to the path that it tries to save it to. Has the bitbucket repo been switched between private/public recently?"
It looks like the phantomjs download is no longer valid (or similar); and the fact that many people are having the same issue at the same time suggests this is probably the case.
I don't know enough to advise you how to proceed but maybe this can point you in the right direction.