element-ui安装解决方案


  在sepFour这个项目里面,安装element-ui时出现了这样子的一个错误

F:\03 prc\prc\sepFour>npm i element-ui -S
npm ERR! Unexpected end of JSON input while parsing near '...rma-spec-reporter":"0'

npm ERR! A complete log of this run can be found in:
npm ERR!     e:\softwareEXP\node.js\node_cache\_logs\2018-09-12T06_13_21_597Z-debug.log

这时候有一个解决方案,就是执行下面的代码后再重新执行一次安装element-ui的命令:

npm cache clean --force

  安装成功会出现下面的提示,可以看到安装的版本是+ element-ui@2.4.6:

Administrator@HTYYEML4JA3HA0P MINGW64 /f/03 prc/prc/noshery
$ npm i element-ui -S
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ element-ui@2.4.6
added 6 packages from 6 contributors in 30.767s

 

  如果再安装不成功,可以试试加sudo提升权限进行-g全局安装。

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM