使用npm install指令时遇到的问题总结
错误描述:npm ERR! Error while executing:npm ERR! D:\Git\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.gitnpm ERR!npm ERR! fatal: unable to access ‘https://github.com/nhn/raphael.git/’: Op
1.OpenSSL SSL_read: Connection was reset, errno 10054
错误描述:
npm ERR! Error while executing:
npm ERR! D:\Git\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git
npm ERR!
npm ERR! fatal: unable to access ‘https://github.com/nhn/raphael.git/’: OpenSSL SSL_read: Connection was reset, errno 10054
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\怦九\AppData\Roaming\npm-cache_logs\2021-10-28T10_24_42_415Z-debug.log
问题关键
OpenSSL SSL_read: Connection was reset, errno 10054
解决方案
执行指令:
git config --global http.sslVerify "false"
2. npm ERR! @1.0.0 dev: webpack-dev-server --progress --config build/webpack.dev.conf.js `
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test1028@1.0.0 dev: webpack-dev-server --progress --config build/webpack.dev.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the test1028@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
问题关键:
webpack 和 webpack-dev-server的版本不兼容
解决方案
npm uninstall webpack
npm uninstall webpack-dev-server
npm install webpack@3.8.1 --save-dev
npm install webpack-dev-server@2.9.1 --save-dev
经测试,3.8.1的webpack和2.9.1的webpack-dev-server是兼容的
3. npm ERR! the command again as root/Administrator
指令提示你需要管理员权限
解决方案有两个:
1、直接以管理员身份运行cmd窗口,然后执行npm install
这样有一个弊端:你需要每次都以管理员身份打开,运行npm install
2、删除C:\Users\用户名 下的.npmrc文件
开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!
更多推荐
所有评论(0)