2
我想寫一些單元測試。我得到的角度是不確定的錯誤,所以我想我需要包括的角度js文件與我的其他js文件......爲此我試圖NPM安裝...測試AngularJS與業力和茉莉花
{
"name": "jzAddons",
"description": "A collection of addons for AngularJS",
"version": "0.0.1",
"private": false,
"devDependencies": {
"angularjs": "git://github.com/angular/angular.js.git",
"grunt": "0.4",
"grunt-contrib-jshint": "0.7.2",
"grunt-contrib-stylus": "0.10.0",
"grunt-contrib-uglify": "0.2.7",
"grunt-contrib-clean": "0.5.0",
"grunt-karma": "*",
"karma": "~0.12",
"karma-chrome-launcher": "*",
"karma-jasmine": "*",
"karma-phantomjs-launcher": "*"
}
}
但npm install
失敗:
> npm install
npm WARN package.json [email protected] No repository field.
npm http GET https://registry.npmjs.org/grunt-contrib-uglify/0.2.7
npm http GET https://registry.npmjs.org/grunt-contrib-jshint/0.7.2
npm http GET https://registry.npmjs.org/grunt-contrib-stylus/0.10.0
npm http GET https://registry.npmjs.org/grunt-contrib-clean/0.5.0
npm http GET https://registry.npmjs.org/grunt-karma
npm http GET https://registry.npmjs.org/grunt
npm http GET https://registry.npmjs.org/karma-chrome-launcher
npm http GET https://registry.npmjs.org/karma-jasmine
npm http GET https://registry.npmjs.org/karma-phantomjs-launcher
npm http GET https://registry.npmjs.org/karma
npm http 304 https://registry.npmjs.org/grunt-contrib-clean/0.5.0
npm http 304 https://registry.npmjs.org/grunt-contrib-stylus/0.10.0
npm http 304 https://registry.npmjs.org/grunt-contrib-uglify/0.2.7
npm http 304 https://registry.npmjs.org/grunt-contrib-jshint/0.7.2
npm http 304 https://registry.npmjs.org/grunt-karma
npm http 304 https://registry.npmjs.org/karma-jasmine
npm http 304 https://registry.npmjs.org/karma-phantomjs-launcher
npm http 304 https://registry.npmjs.org/karma-chrome-launcher
npm http 304 https://registry.npmjs.org/grunt
npm http 304 https://registry.npmjs.org/karma
npm ERR! Error: No version provided
npm ERR! at needVersion (/usr/local/lib/node_modules/npm/lib/cache.js:1238:40)
npm ERR! at /usr/local/lib/node_modules/npm/lib/cache.js:1112:10
npm ERR! at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR! <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR! <[email protected]>
npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/jzaun/Development/jzAddons
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/jzaun/Development/jzAddons/npm-debug.log
npm ERR! not ok code 0
我如何角來進行測試?
有什麼辦法可以使用grunt來安裝某些形式的窗臺而不必製作bower.json嗎?我真的不想處理2套裝系統: - /我不需要Angular來測試任何東西,而且看起來很愚蠢,必須經歷所有的環節......
我從來沒有使用'「*」'但根據[這個問題](http://stackoverflow.com/questions/16073603/how-do-i-update-each - 依賴於包的JSON到最新版本),它應該工作。有沒有突然的變化? – glepretre
問題是我無法獲得npm安裝角度。看起來我不得不使用涼亭除了npm。 PITA。 – Justin808
犯錯。對不起,我可能會誤解你,但在npm中,你可以安裝節點包,比如yo或generator-angular。鮑爾是另一回事。它管理你的web應用程序的JavaScript依賴關係。所以angular.js或jquery或bootstrap.css是bower需要處理的事情。而使用npm安裝諸如karma,grunt,yeoman等nodejs模塊。請參閱:http://stackoverflow.com/questions/18641899/difference-between-bower-and-npm – PeterFromCologne