Windows 7上执行Cake 报错原因是Powershell 版本问题
在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 版本问题的更多相关文章
- windows slaver 脚本执行xcopy 报错无效驱动器规格
jenkins上配置的windows slaver机器如下: 我用这台windows 机器作为slaver机器来编译pc的exe包,但是在最后归档包倒ftp上时报错,如下: 但是我直接在windows ...
- crontab执行python报错原因总结
1.相对路径导致 2.环境变量问题,py脚本首行应指定python路径,不能用软链接 3.python3.3是默认utf-8,需要 &&脚本 最好使用crontab -e ...
- jenkins slave上执行脚本报错
jenkins slave上执行脚本报错 解决方法:在系统配置中设置shell execuate C:\Windows\system32\cmd.exe 保存即可
- Jstorm执行task报错windows CONFIG SET protected-mode no
windows CONFIG SET protected-mode no报错说redis受保护模式,redis使用的是Redis-x64-3.2.100,参考博文说是redis3.2之后加入的特性, ...
- 在windows上 使用celery 报错
在windows上 使用celery 报错 在windows上 使用celery 报错 ValueError: not enough values to unpack (expected ...
- 执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client
1.执行Spark运行在yarn上的命令报错 spark-shell --master yarn-client,错误如下所示: // :: ERROR SparkContext: Error init ...
- 数据库执行sql报错Got a packet bigger than 'max_allowed_packet' bytes及重启mysql
准备在mysql上使用数据库A,但mysql5经过重装后,上面的数据库已丢失,只得通过之前备份的A.sql重新生成数据库A. 1.执行sql报错 在执行A.sql的过程中,出现如下错误:Got a p ...
- 转 sqlplus执行sql报错:ORA-01756:
1.sqlplus执行sql报错:ORA-01756: quoted string not properly terminated 分类: 技术 在SQLPLUS中执行SQL文件时 ...
- memcached 笔记之windows 7 下面 安装memcached 报错
windows 7 下面 安装memcached 报错 两种情况: 一:服务确实已经安装过 .如需要重新安装,当然是先memcached.exe -d uninstall 二:奇怪的是服务确实没有安装 ...
随机推荐
- nodejs进阶(6)—连接MySQL数据库
1. 建库连库 连接MySQL数据库需要安装支持 npm install mysql 我们需要提前安装按mysql sever端 建一个数据库mydb1 mysql> CREATE DATABA ...
- 浅谈我对DDD领域驱动设计的理解
从遇到问题开始 当人们要做一个软件系统时,一般总是因为遇到了什么问题,然后希望通过一个软件系统来解决. 比如,我是一家企业,然后我觉得我现在线下销售自己的产品还不够,我希望能够在线上也能销售自己的产品 ...
- iOS开发之Masonry框架源码深度解析
Masonry是iOS在控件布局中经常使用的一个轻量级框架,Masonry让NSLayoutConstraint使用起来更为简洁.Masonry简化了NSLayoutConstraint的使用方式,让 ...
- 从netty-example分析Netty组件
分析netty从源码开始 准备工作: 1.下载源代码:https://github.com/netty/netty.git 我下载的版本为4.1 2. eclipse导入maven工程. netty提 ...
- SDWebImage源码解读 之 UIImage+GIF
第二篇 前言 本篇是和GIF相关的一个UIImage的分类.主要提供了三个方法: + (UIImage *)sd_animatedGIFNamed:(NSString *)name ----- 根据名 ...
- Mysql基础代码(不断完善中)
Mysql基础代码,不断完善中~ /* 启动MySQL */ net start mysql /* 连接与断开服务器 */ mysql -h 地址 -P 端口 -u 用户名 -p 密码 /* 跳过权限 ...
- 负载均衡——nginx理论
nginx是什么? nginx是一个强大的web服务器软件,用于处理高并发的http请求和作为反向代理服务器做负载均衡.具有高性能.轻量级.内存消耗少,强大的负载均衡能力等优势. nginx架构? ...
- iOS之开发中一些相关的路径以及获取路径的方法
模拟器的位置: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs ...
- 微信小程序二维码推广统计
微信小程序可以通过生成带参数的二维码,那么这个参数是可以通过APP的页面进行监控的 这样就可以统计每个二维码的推广效果. 今天由好推二维码推出的小程序统计工具HotApp小程序统计也推出了带参数二维码 ...
- T-SQL学习记录
T-sql是对SQL(structure query language )的升级.可以加函数. 系统数据库:master管理数据库.model模版数据库,msdb备份等操作需要用到的数据库,tempd ...