npm安装无法执行postinstall脚本bower安装

时间:2014-10-19 15:44:44

标签: npm bower

我在网上偷了超过48小时&没能解决这个问题。

当我运行'npm install'命令时,它无法执行postinstall脚本'bower install'。所以,我使用以下方法进行了明确的bower安装:

$npm install -g bower

$bower install

在此之后,'app / bower_components'文件夹已填充好。但是,当我尝试'npm install'时,同样的问题。无法继续下去。

我执行了以下&没有成功安装:

  1. 安装了Git&它的路径添加在PATH环境变量中。然后运行'npm install'。甚至重新启动命令提示符以便反映PATH变量。
  2. 运行'npm install restify',虽然我不知道为什么必须将安装作为REST服务。 我用过这个,因为这是我遇到的一个建议。
  3. 在某些帖子中,有人提到它可能是由于防火墙设置造成的。禁用同样的&也试过了。
  4. 将我的项目'angular-phonecat'下的所有文件更改为具有读写权限。通过取消选中整个文件夹内容的“只读”选项来实现此目的。
  5. 以管理员身份运行Git Bash&试过'npm install'。
  6. 请帮我运行这款应用。 :(

    在我的日志下面找到:

    600 info install angular-phonecat@0.0.0  
    601 info postinstall angular-phonecat@0.0.0  
    602 verbose unsafe-perm in lifecycle true  
    603 info angular-phonecat@0.0.0 Failed to exec postinstall script  
    604 error angular-phonecat@0.0.0 postinstall: `bower install`  
    604 error spawn ENOENT  
    605 error Failed at the angular-phonecat@0.0.0 postinstall script.  
    605 error This is most likely a problem with the angular-phonecat package,  
    605 error not with npm itself.  
    605 error Tell the author that this fails on your system:  
    605 error     bower install  
    605 error You can get their info via:  
    605 error     npm owner ls angular-phonecat  
    605 error There is likely additional logging output above.  
    606 error System Windows_NT 6.2.9200  
    607 error command "g:\\Workspace\\AngularProjects\\angular-phonecat\\node.exe" "g:\\Workspace\\AngularProjects\\angular-phonecat\\node_modules\\npm\\bin\\npm-cli.js" "install"  
    608 error cwd g:\Workspace\AngularProjects\angular-phonecat  
    609 error node -v v0.10.32  
    610 error npm -v 1.4.28  
    611 error syscall spawn  
    612 error code ELIFECYCLE  
    613 error errno ENOENT  
    614 verbose exit [ 1, true ]  
    

2 个答案:

答案 0 :(得分:0)

您需要提供更多信息才能获得此问题的答案。看起来angular-phonecat是您自己创建的模块 - 请将其package.json作为要点[{3}}发布并在此处附加链接?

此外,您的npm相当陈旧(甚至在您提出此问题时)。我建议更新到最新版本的npm,在撰写本文时为2.2.0。

要在Windows上更新npm,请按照此处的说明操作:https://gist.github.com

谢谢!

答案 1 :(得分:0)

尝试npm-check模块来测试任何组件是否过时