小编Gab*_*ult的帖子

安装angular2-notifications后运行lint失败

我最近使用Angular-CLI创建了一个新的Angular4项目.

我遇到的问题是在安装angular2-notifications之后,运行ng lint命令时出错.

错误:

无法加载C:\ Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo \node_modules\angular2-notifications\tslint.json:找不到自定义规则目录:C:\ Users\Gabriel\Documents\GitHub\Go- NOGO\GoNoGo \node_modules\angular2的通知\node_modules\codelyzer

堆栈跟踪 :

at new FatalError (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\tslint\lib\error.js:40:23)
at Object.findConfiguration (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\tslint\lib\configuration.js:47:15)
at files.forEach (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:36:50)
at Array.forEach (native)
at lintConfigs.map (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:30:19)
at Array.map (native)
at Class.run (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:21:14)
at Class.run (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\commands\lint.js:45:25)
at Class.Command.validateAndRun (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\ember-cli\lib\models\command.js:128:15)
at C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:92:22
Run Code Online (Sandbox Code Playgroud)

我已经转向谷歌这个问题,没有任何运气.我去过GitHub回购,也没有运气.

然后我进入tslint.json了angular2-notifications包的实际文件.

我在顶部看到这个:

"rulesDirectory": [
    "node_modules/codelyzer"
],
Run Code Online (Sandbox Code Playgroud)

当我删除这3行时,该ng lint命令有效.

我的问题是,我在这里遗漏了什么吗?我需要这个命令才能工作,我不认为修改包是一个可接受的解决方案.这是包装本身的一个错误,我应该向他们报告?

谢谢

lint npm tslint angular

7
推荐指数
1
解决办法
3105
查看次数

使用 Powershell 创建 signalR 客户端 HubConnection

我正在尝试使用 powershell 脚本连接到 SignalR 集线器。我对 powershell 很陌生,所以请原谅任何菜鸟错误。

我已经设置了一个我在这里尝试过的最小的不起作用的示例 要点

相关代码:

加载dll

$dllFolder = -join((Get-Item -Path ".\" -Verbose).FullName, "\bin\Debug\")
[string[]] $dllPathsToLoad = @("\Newtonsoft.Json.dll", "\Microsoft.AspNet.SignalR.Client.dll")
$token = "insertyourtokenhere"

function LoadDllPaths($dlls)
{
    foreach ($dll in $dlls)
    {
        $dllpath = $dllFolder + $dll
        [System.Reflection.Assembly]::LoadFrom($dllpath)
    }
}
[...]
LoadDllPaths($dllPathsToLoad)
Run Code Online (Sandbox Code Playgroud)

创建集线器连接:

$server = "https://localhost/rest/"
[...]
$hub = New-Object Microsoft.AspNet.SignalR.Client.HubConnection($server)
Run Code Online (Sandbox Code Playgroud)

脚步:

  1. 创建一个新的 Visual Studio 项目
  2. 添加Newtonsoft.Json v10.0.2 Nuget包(最新)
  3. 添加 Microsoft.AspNet.SignalR.Client v2.2.2 Nuget 包(最新)
  4. 将 powershell 脚本添加到项目的根目录
  5. 使用 powershell(以管理员身份运行),输入.\HubConnectionTestsScript.ps1

结果:

输出

在 imgur 上查看

Error : System.Management.Automation.MethodInvocationException: …
Run Code Online (Sandbox Code Playgroud)

c# asp.net powershell nuget signalr

5
推荐指数
1
解决办法
2406
查看次数

标签 统计

angular ×1

asp.net ×1

c# ×1

lint ×1

npm ×1

nuget ×1

powershell ×1

signalr ×1

tslint ×1