cannot start angular-phonecat, postinstall script failing [closed]

时光怂恿深爱的人放手 提交于 2020-01-04 09:10:21

问题


I am currently setting up a vagrant box for starting the development of experimental node.js + angularjs app. Since I am just starting with angular, I want to give a first try to the angular-phonecat app, the one given as a tutorial by google.

I installed node in the guest machine, and the synced folder is where I cloned the angular-phonecat github repo (at the host machine but since it's synced, this shouldn't matter). In other words: all the files in the repo are present at my filesystem too.

I followed the steps mentioned at https://docs.angularjs.org/tutorial (step 0). Of course, I installed node at the guest machine.

The problem comes after the first time I run "npm install". The postinstall script is failing, so after this some dependencies are missing. I can start the server and access it from my host machine, where I see there are some 404 errors when trying to fetch jquery and other libraries from my host machine. Of course they are not there, and altough I could place them manually, this is not the way it should be.

This is the error I get

npm ERR! angular-phonecat@0.0.0 postinstall: `bower install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the angular-phonecat@0.0.0 postinstall script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     bower install
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0

If I do what the error suggests in order to track it down, I get

vagrant@precise64:/vagrant/angular-phonecat$ npm owner ls angular-phonecat 
npm ERR! owner ls Couldn't get owner data angular-phonecat
npm ERR! 404 404 Not Found: angular-phonecat
npm ERR! 404 
npm ERR! 404 'angular-phonecat' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.

npm ERR! System Linux 3.2.0-23-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "owner" "ls" "angular-phonecat"
npm ERR! cwd /vagrant/angular-phonecat
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! code E404
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /vagrant/angular-phonecat/npm-debug.log
npm ERR! not ok code 0

So I am a bit stuck since I do not know how to interpret this second message. Any ideas? Anyone with a similar problem over there?


回答1:


Already found it. I was tracking the wrong clue.

Git was not installed at the guest machine. I found this when I tried to run "bower install".

While git at the guest machine was not necessary for following the steps given at the angular-phonecat tutorial, it's used by bower to fetch the dependencies, and its absence was causing the postinstall script to fail.



来源:https://stackoverflow.com/questions/24394533/cannot-start-angular-phonecat-postinstall-script-failing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!