无法安装Angular-hint

时间:2015-01-17 08:10:07

标签: angularjs npm

最近我发现这篇文章(http://blog.thoughtram.io/angularjs/2014/11/06/exploring-angular-1.3-angular-hint.html),似乎Angular-hint对开发人员非常有用。所以,我尝试用这个命令安装Angular-hint:

npm install angular-hint

在安装过程中,我看到angular-hint文件夹中包含在node_modules文件夹中创建的文件。但是在安装结束时,一切都消失了。在命令窗口中,我看到了:

E:\www\angularjs\angular-hint\node_modules\angular-hint\node_modules\angular-hint-log\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild
npm ERR! EEXIST, open 'C:\Users\MyPC\AppData\Roaming\npm-cache\50d41671-che-browserify-4-2-3-package-tgz.lock.STALE'
File exists: C:\Users\MyPC\AppData\Roaming\npm-cache\50d41671-che-browserify-4-2-3-package-tgz.lock.STALE
Move it away, and try again.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "angular-hint"
npm ERR! cwd E:\www\angularjs\angular-hint
npm ERR! node -v v0.10.34
npm ERR! npm -v 1.4.28
npm ERR! path C:\Users\MyPC\AppData\Roaming\npm-cache\50d41671-che-browserify-4-2-3-package-tgz.lock.STALE
npm ERR! code EEXIST
npm ERR! errno 47
npm ERR! not ok code 0

如何正确安装?

2 个答案:

答案 0 :(得分:0)

试试这个:

$ sudo npm install angular-hint --save-dev

我们使用--save-dev使其成为dev依赖项 如果这对你不起作用,请尝试凉亭!

你可以使用凉亭。

$ sudo npm install -g bower
$ bower search angular-hint
$ search results:
    angular-hint git://github.com/angular/angular-hint.git
    angular-hint2 git://github.com/mallowigi/angular-hint.git

$ bower init
$ bower install angular-hint --save

答案 1 :(得分:0)

除了格伦的回答。使用 bower 安装 angular-hint 后,您必须转到创建的目录并运行以下命令:

$ npm install

安装angular-hint和

所需的依赖项
$ npm run build

使用最终dist文件生成hint.js目录。

或者,您可以使用angular-hint-bower