2016-04-14 50 views
10

我想添加jquery-validation到visual studio 2015中的項目。當我添加「jquery-validation」到bower.json時,我看到jquery-validation文件夾被添加到wwwroot/lib /但沒有dist /文件夾。jquery-validation丟失dist文件夾

jquery-validation包看起來需要構建,但我看不到如何從visual studio 2015內部構建。右鍵單擊grunt文件時不顯示任務運行器資源管理器。

如果我使用一個命令行窗口,並嘗試使用「故宮安裝」,並在wwwroot文件/ lib中/ jQuery的驗證/文件夾「咕嚕」我得到了後一個錯誤「JSCS:所有的」任務:

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! [email protected] prepublish: `grunt` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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 

我必須錯過簡單的東西!

+0

我有幾乎相同的問題。 Grunt必須建立dist文件夾,但會失敗,因爲Windows系統停止建立超過260個字符的路徑。 – Kirsten

+0

你有沒有想過如何解決這個問題?我現在正在努力。 – WBuck

+0

同樣在這裏 - 下面的答案似乎都不適用於我 - 我得到了與OP – lesscode

回答

1

npm 2生成幾個嵌套的文件夾,導致Windows上的路徑出現bug。如果這是問題,那麼你應該更新到npm 3他們修復它。

npm i -g npm 
3

我也有類似的問題,並能夠通過安裝咕嚕全球然後NPM運行安裝在jQuery的驗證文件夾來解決它:

  1. 打開節點JS命令提示符並運行npm install -g grunt
  2. 在任何命令提示(I用於從VS顯影劑命令提示)導航到jquery-validation文件夾並運行npm install

甲從前面看,jquery-validation\dist文件夾應該與jquery.validate.js文件一起顯示。