Angularjs 安装角度提示时出现问题
最近我发现了这篇文章(),它似乎对开发人员非常有用。因此,我尝试使用以下命令安装Angular hint:Angularjs 安装角度提示时出现问题,angularjs,npm,Angularjs,Npm,最近我发现了这篇文章(),它似乎对开发人员非常有用。因此,我尝试使用以下命令安装Angular hint: npm install angular-hint 在安装过程中,我看到angular hint文件夹,其中包含在node\u modules文件夹中创建的文件。但在安装结束时,一切都消失了。在命令窗口中,我看到以下内容: E:\www\angularjs\angular-hint\node_modules\angular-hint\node_modules\angular-hint-lo
npm install angular-hint
在安装过程中,我看到angular hint文件夹,其中包含在node\u 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
如何正确安装它?尝试以下方法:
$ 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
除了格伦的回答。使用bower安装angular hint后,必须转到创建的目录并运行以下命令:
$ npm install
安装angular hint和所需的依赖项
$ npm run build
使用最终的hint.js
文件生成dist
目录
或者,您也可以直接使用。消息上写着:“移开它,再试一次。”。你试过了吗?@JBNizet是的,我试过了。但这没用。我在其他电脑上试过,结果一样。谢谢你的回答。现在我使用bower安装Angular hint,并将
hint.js
加载到我的应用程序中。但是,它在控制台中显示错误:未捕获引用错误:未定义require
。我如何解决它?这里的问题相同:Uncaught ReferenceError:require未定义