在Windows 7 SP1 电脑上执行Cake的的例子 http://cakebuild.net/docs/tutorials/getting-started ,运行./Build.ps1 报下面的错误

PS D:\Workshop\GitHub\cakebuildexample> ./build.ps1 -Target Default

Preparing to run build script...

Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:50 字符: 23

+ $TOOLS_DIR = Join-Path <<<< $PSScriptRoot "tools"

+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCom

mand

Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:51 字符: 23

+ $NUGET_EXE = Join-Path <<<< $TOOLS_DIR "nuget.exe"

+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCom

mand

Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:53 字符: 22

+ $CAKE_EXE = Join-Path <<<< $TOOLS_DIR "Cake/Cake.exe"

+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCom

mand

Join-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:54 字符: 29

+ $PACKAGES_CONFIG = Join-Path <<<< $TOOLS_DIR "packages.config"

+ CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCom

mand

Test-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:77 字符: 15

+ if ((Test-Path <<<< $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {

+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom

mand

Test-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:83 字符: 16

+ if (!(Test-Path <<<< $PACKAGES_CONFIG)) {

+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom

mand

Test-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:91 字符: 16

+ if (!(Test-Path <<<< $NUGET_EXE)) {

+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom

mand

Test-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:102 字符: 16

+ if (!(Test-Path <<<< $NUGET_EXE)) {

+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom

mand

Set-Location : 无法处理参数,因为参数“path”的值为空。请将参数“path”的值更改为非空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:119 字符: 17

+ Set-Location <<<< $TOOLS_DIR

+ CategoryInfo : InvalidArgument: (:) [Set-Location], PSArgumentNullException

+ FullyQualifiedErrorId : ArgumentNull,Microsoft.PowerShell.Commands.SetLocationCommand

管道元素中“&”后的表达式生成的对象无效。该表达式必须生成命令名称、脚本块或 CommandInfo 对象。

所在位置 行:1 字符: 2

+ & <<<< "" install -ExcludeVersion -OutputDirectory ""

+ CategoryInfo : InvalidOperation: (:String) [], RuntimeException

+ FullyQualifiedErrorId : BadExpression

Test-Path : 无法将参数绑定到参数“Path”,因为该参数是空值。

所在位置 D:\Workshop\GitHub\cakebuildexample\build.ps1:133 字符: 16

+ if (!(Test-Path <<<< $CAKE_EXE)) {

+ CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException

+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCom

mand

Running build script...

管道元素中“&”后的表达式生成的对象无效。该表达式必须生成命令名称、脚本块或 CommandInfo 对象。

所在位置 行:1 字符: 2

+ & <<<< "" "build.cake" -target="Default" -configuration="Release" -verbosity="Verbose"

+ CategoryInfo : InvalidOperation: (:String) [], RuntimeException

+ FullyQualifiedErrorId : BadExpression

上述报错有很多,问题的根源是PowerShell的版本问题,查了下我机器上是2.0版本的

PS D:\Workshop\GitHub\cakebuildexample> $PSVersionTable.PSVersion

Major Minor Build Revision

----- ----- ----- --------

2 0 -1 –1

解决办法就是升级(建议升级3.0 能够成功解决),Windows Management Framework 3.0 下载地址:https://www.microsoft.com/en-us/download/details.aspx?id=34595 ,安装后就可以成功执行了。

相关文章

Windows 7上执行Cake 报错原因是Powershell 版本问题的更多相关文章

  1. windows slaver 脚本执行xcopy 报错无效驱动器规格

    jenkins上配置的windows slaver机器如下: 我用这台windows 机器作为slaver机器来编译pc的exe包,但是在最后归档包倒ftp上时报错,如下: 但是我直接在windows ...

  2. crontab执行python报错原因总结

    1.相对路径导致   2.环境变量问题,py脚本首行应指定python路径,不能用软链接   3.python3.3是默认utf-8,需要 &&脚本   最好使用crontab -e ...

  3. jenkins slave上执行脚本报错

    jenkins slave上执行脚本报错 解决方法:在系统配置中设置shell execuate C:\Windows\system32\cmd.exe 保存即可

  4. Jstorm执行task报错windows CONFIG SET protected-mode no

    windows  CONFIG SET protected-mode no报错说redis受保护模式,redis使用的是Redis-x64-3.2.100,参考博文说是redis3.2之后加入的特性, ...

  5. 在windows上 使用celery 报错

    在windows上 使用celery 报错       在windows上 使用celery 报错 ValueError: not enough values to unpack (expected ...

  6. 执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client

    1.执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client,错误如下所示: // :: ERROR SparkContext: Error init ...

  7. 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql

    准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...

  8. 转 sqlplus执行sql报错:ORA-01756:

    1.sqlplus执行sql报错:ORA-01756: quoted string not properly terminated   分类: 技术         在SQLPLUS中执行SQL文件时 ...

  9. memcached 笔记之windows 7 下面 安装memcached 报错

    windows 7 下面 安装memcached 报错 两种情况: 一:服务确实已经安装过 .如需要重新安装,当然是先memcached.exe -d uninstall 二:奇怪的是服务确实没有安装 ...

随机推荐

  1. 你必须知道的EF知识和经验

    注意:以下内容如果没有特别申明,默认使用的EF6.0版本,code first模式. 推荐MiniProfiler插件 工欲善其事,必先利其器. 我们使用EF和在很大程度提高了开发速度,不过随之带来的 ...

  2. Windows2012R2备用域控搭建

    Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自己的ip,备dns:备域控的ip备域控的主dns:自己的ip,备dns:主域控的ip 客户端主dns:主域控的ip,备dns: ...

  3. 记一次SQLServer的分页优化兼谈谈使用Row_Number()分页存在的问题

    最近有项目反应,在服务器CPU使用较高的时候,我们的事件查询页面非常的慢,查询几条记录竟然要4分钟甚至更长,而且在翻第二页的时候也是要这么多的时间,这肯定是不能接受的,也是让现场用SQLServerP ...

  4. 使用Visual Studio SDK制作GLSL词法着色插件

    使用Visual Studio SDK制作GLSL词法着色插件 我们在Visual Studio上开发OpenGL ES项目时,避免不了写Shader.这时在vs里直接编辑shader就会显得很方便. ...

  5. 多个Img标签之间的间隙处理方法

    1.多个标签写在一行 <img src="/i/eg_tulip.jpg" alt="郁金香" height="100px"/> ...

  6. C#通过NPOI操作Excel

    参考页面: http://www.yuanjiaocheng.net/webapi/create-crud-api-1-post.html http://www.yuanjiaocheng.net/w ...

  7. Tomcat常见问题及常用命令

    很长时间不用tomcat好多命令都忘记了,所以准备自己记录下来,以便参考.刚好也希望可以开始养成记博客的好习惯. 1.查看java的版本号 进入java的安装目录后,使用命令:java -versio ...

  8. Atitit.如何建立研发体系

    Atitit.如何建立研发体系 组织,流程,prj..Mana  oppm 发管理是一个完整的管理体系,从结构上来讲,它主要由四个方面的内容构架而成:组织结构与岗位设置 管理流程与工作流程..项目及管 ...

  9. firebug不能加载JS文件 ,无法进行JS脚本调试

    提示: 本页面不包含 Javascript 如果 <script> 标签有 "type" 属性,其值应为 "text/javascript" 或者& ...

  10. CentOS 7 安装出现 /dev/root does not exits 导致无法安装的问题

    本人在官网下的是这个 CentOS-7-x86_64-DVD-1611.iso ,然后用UltraISO 9.6制作的U盘启动盘,不过在安装的时候出现了这个错误, 然后也是搜了好久,试了一下,下面这个 ...