user3050980
user3050980

Reputation: 1

npm ERR [email protected] install: 'node install.js'

I was doing tutorial: http://www.bradoncode.com/tutorials/mean-stack-tutorial-part-1-setup/

Trying to install meanjs. All is almost ok but at the end installation fails due to failing installation of phantomjs.

Here is a piece of error log it outputs:

npm ERR [email protected] install: 'node install.js'
npm ERR  Exit status code 1
npm ERR
npm ERR  Failed at the [email protected] install script.
npm ERR This is most likely a problem with 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 There is likely addidional logging output above.
npm ERR System Windows_NT 6.1.7601
npm ERR command "D:\\servers\\node\\\\node.exe" "D:\\servers\\node\\node_modules\\npm\\bin\\npm-cli.js" "install"

I am on Windows 7 with node v0.10.31 installed.

Upvotes: 0

Views: 1948

Answers (1)

Tony He
Tony He

Reputation: 126

I hit the same error trying to install phantomjs, and eventually worked around it by manually installing both phantomjs and the package that was dependent on it:

  1. Grab the source here: https://github.com/Medium/phantomjs
  2. Put it in a folder "phantomjs" and put that under the "node_modules" folder of your project or the module that depends on phantomjs.
  3. Navigate to "phantomjs" and run "node ./install.js"
  4. At this point, I got an error saying that "request-progress" (one of phantomjs's dependencies) couldn't be found. This probably explains why we hit "npm ERR Failed at the [email protected] install script." when we try to install it using npm. While you're still in the phantomjs folder, run "npm install request-progress." Now if you run "node ./install.js" again, it should work.
  5. In my case, I was trying to install the module html5-to-pdf, a dependent of phantomjs. I was still getting an error about phantomjs if I try to "npm install html5-to-pdf". I then copied the html5-to-pdf source to my project and put the "phantomjs" folder under the node_modules folder of html5-to-pdf. I then ran "npm install " for each of html5-to-pdf's dependencies except for phantomjs.
  6. Finally, when I ran "npm install" and "npm update" in my root project folder, I no longer got any errors about phantomjs. I just verified that phantomjs is in fact working in my project.

Maybe there's a better way to work around this, but after trying all sorts of ideas the entire day, only this worked for me. Good luck to you!

Upvotes: 1

Related Questions