Node.js问题:: Angular没有定义::无法罚款鲍尔包:: nodegyp与Python

问题:在浏览器中生成并启动我的新jHipster API后,出现以下问题:

未捕获的ReferenceError:未定义angular度

这代人之前我安装了最新的:

  • 的node.js
  • 亭子
  • 根据指导方针, grunt-cli

这一代中,我得到了以下警告和错误:

我都完成了。 运行npm install&bower install来安装所需的依赖项。 如果失败,请尝试自己运行命令。

bufferutil@1.2.1安装K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ bufferutil node-gyp重buildK:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ bufferutil>如果未定义npm_config_node_gyp(node“C:\ Users \节点gyp.js“重build)其他(节点重build)gyp错误!\ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ node-gyp-bin …. \ node_modules \ node-gyp \ bin \ configuration错误gyp ERR! 堆栈错误:找不到Python可执行文件“python”,可以设置PYTHON envvariables。 gyp ERR! 堆栈在failNoPython(C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ configure.js:401:14)gyp ERR! 堆栈在C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ configure.js:356:11 gyp ERR! 堆栈在FSReqWrap.oncomplete(fs.js:82:15)gyp ERR! 系统Windows_NT 6.1.7601 gyp ERR! 命令“C:\ Program Files \ nodejs \ node.exe”“C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“rebuild”gyp呃! cwd K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ bufferutil gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! 不行npm WARN安装:bufferutil@1.2.1 bufferutil@1.2.1安装:node-gyp rebuild npm WARN安装:bufferutil@1.2.1退出状态1

utf8-validate@1.2.1 install K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ utf-8-validate node-gyp rebuild K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ utf-8-validate >如果没有定义npm_config_node_gyp(节点“C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ bin \ node-gyp-bin …. \ node_modules \ node-gyp \ bin \ node-gyp.js “重build)其他(节点重build)gyp ERR! configuration错误gyp ERR! 堆栈错误:找不到Python可执行文件“python”,可以设置PYTHON envvariables。 gyp ERR! 堆栈在failNoPython(C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ configure.js:401:14)gyp ERR! 堆栈在C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ lib \ configure.js:356:11 gyp ERR! 堆栈在FSReqWrap.oncomplete(fs.js:82:15)gyp ERR! 系统Windows_NT 6.1.7601 gyp ERR! 命令“C:\ Program Files \ nodejs \ node.exe”“C:\ Users \ korban \ AppData \ Roaming \ npm \ node_modules \ npm \ node_modules \ node-gyp \ bin \ node-gyp.js”“rebuild”gyp呃! cwd K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \ node_modules \ utf-8-validate gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! 不行npm WARN安装:utf-8-validate@1.2.1 utf-8-validate@1.2.1安装:node-gyp rebuild npm WARN安装:utf-8-validate@1.2.1退出状态1 npm WARN可选跳过失败的可选依赖项/ chokidar / fsevents:npm WARN notsup不兼容您的操作系统或体系结构:fsevents@1.0.6 bower angular-aria#1.4.8 ENOGIT git未安装或不在PATH中运行“ngconstant:dev”( ngconstant)任务在src / main / webapp / scripts / app / app.constants.js创build模块aicwebadminapiApp … OK

运行“wiredep:app”(wiredep)任务警告:错误:找不到您的Bower软件包的位置。 使用–force继续。

由于警告而中止。

我对以下事项做了长时间的调查

  • node_gyp与Python问题
  • “无法find凉亭包”的问题
  • “angular度未定义”的问题

但我没有find一个工作的解决scheme。

注意: mvn clean install和mvn spring-boot:运行成功!

如果你有任何有用的想法来分享这个我真的appreaciate它!

提前谢谢你的帮助!

@@@@@@@@@@@@@@@@@@@@@@@@

最终解决scheme

修复node_gyp vs Python问题:

  • 降级到:Node.js 4.2.3 LTS和npm 2.14.7,
  • 安装Python 2.7.10和Visual Studio Express( www.microsoft.com/en-gb/download/details.aspx?id=44914 )(请参阅node- gyp依赖项: github.com/nodejs/node-gyp#installation

修复“无法find凉亭包”问题和“angular度未定义”的问题:

注意:首先使用rff-doctor( github.com/rakuten-frontend/rff-doctor )来validation使用Yeoman,Grunt和Bower等的系统configuration。它会告诉你什么是缺less的,你如何购买它/他们。

我的情况是什么错过了:

  • 安装Git( git-scm.com/downloads )并将其设置为使用https而不是使用以下命令的git config --global url."https://".insteadOf git://git config --global url."https://".insteadOf git://
  • 安装Ruby( www.ruby-lang.org/ )并将其添加到PATH
  • 使用gem安装Sass: gem install sass并将其添加到PATH

关于在Windows上设置NodeJS环境的几点build议:

  • 不要安装最后的NodeJS版本,而要安装最新的LTS版本(长期支持)
  • 不要使用npm 3
  • 不要使用深的项目文件夹path(如“K:\ work \ HP_AIC_WebAdmin_Customization \ workspace \ aicwebadminapi \”),因为npm可能会达到您的node_modules内容的最大path长度。
  • 安装Python 2.x不是3.x

考虑使用nodist或其他类似nvm的工具来安装节点。

你还必须解决git错误,鲍尔需要一些模块在npmregistry中找不到的模块。 您必须通过安装git来修复您的环境,并在重试“bower install命令”之前确保“git”命令在您的path中可用。 一些git安装正确,但由于被企业防火墙阻止而无法工作。

你也可以尝试运行像rff-doctor这样的诊断工具来testing你的git,grunt,bower和node的环境。 不要遵循其关于Ruby和SASS的build议,因为JHipster不需要它们(它通过grunt / gulp使用libsass)。