【问题标题】:jquery-validation missing dist folderjquery-validation 缺少 dist 文件夹
【发布时间】:2016-08-06 05:34:39
【问题描述】:

我正在尝试将 jquery-validation 添加到 Visual Studio 2015 中的项目。当我将“jquery-validation”添加到 bower.json 时,我看到 jquery-validation 文件夹已添加到 wwwroot/lib/ 但没有dist/ 文件夹。

jquery-validation 包看起来需要构建,但我看不到如何从 Visual Studio 2015 中构建。右键单击 grunt 文件不会显示任务运行器资源管理器。

如果我使用命令窗口并尝试在 wwwroot/lib/jquery-validation/ 文件夹中使用“npm install”和“grunt”,我会在“jscs:all”任务之后收到错误:

Running "jscs:all" (jscs) task
Fatal error: Neither config file nor grunt options were defined

npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code ELIFECYCLE
npm ERR! jquery-validation@1.15.1-pre prepublish: `grunt`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jquery-validation@1.15.1-pre prepublish script 'grunt'.
npm ERR! This is most likely a problem with the jquery-validation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     grunt
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs jquery-validation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls jquery-validation
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     E:\asp.net 5 ef7 bootstrap anygular web app\4-aspdotnet-5-ef7-bootstrap-angular-web-app-m4-exercise-files\after\src\TheWorld\wwwroot\lib\jquery-validation\npm-debug.log

我一定错过了一些简单的东西!

【问题讨论】:

  • 我有几乎同样的问题。 Grunt 必须建立 dist 文件夹但失败了,因为 Windows 系统停止建立超过 260 个字符的路径。
  • 你有没有想过如何解决这个问题?我现在正在为此苦苦挣扎。
  • 这里相同 - 下面的答案似乎都不适合我 - 我得到与 OP 相同的错误
  • 这里有什么帮助吗??

标签: visual-studio-2015 jquery-validation-engine


【解决方案1】:

我遇到了类似的问题,可以通过全局安装 grunt 然后在 jquery-validation 文件夹中运行 npm install 来解决它:

  1. 打开node js命令提示符并运行npm install -g grunt
  2. 在任何命令提示符下(我使用 VS 的开发人员命令提示符)导航到 jquery-validation 文件夹并运行 npm install

之后,jquery-validation\dist 文件夹应与 jquery.validate.js 文件一起显示。

【讨论】:

    【解决方案2】:

    npm 2 会生成几个嵌套文件夹,这会导致 Windows 上的路径出错。如果这是问题,那么您应该更新到他们修复它的 npm 3。

    npm i -g npm
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-13
      • 2014-09-20
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      • 2015-06-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多