执行命令npm i element-ui -S安装Element组件时报错
C:\Windows\system32>npm i element-ui -S
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
npm notice
npm notice New minor version of npm available! 8.5.5 -> 8.19.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.19.2
npm notice Run npm install -g npm@8.19.2 to update!
npm notice
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR! D:\AllTools\nodejs\node_cache\_logs\2022-09-30T07_14_17_924Z-debug-0.log
New minor version of npm available! 8.5.5 -> 8.19.2应该是要更新npm
npm install -g npm
执行npm i element-ui -S再次报错
解决:
npm cache clean --force
npm install npm@6.14.10 -g
npm config list
npm i element-ui -S
d:\AllTools\nodejs>npm cache clean --force
npm WARN using --force Recommended protections disabled.
d:\AllTools\nodejs>npm install npm@6.14.10 -g
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/
removed 73 packages, and changed 98 packages in 27s
3 packages are looking for funding
run `npm fund` for details
d:\AllTools\nodejs>npm config set registry https://registry.npm.taobao.org
d:\AllTools\nodejs>npm config list
; cli configs
metrics-registry = "https://registry.npm.taobao.org/"
scope = ""
user-agent = "npm/6.14.10 node/v16.14.2 win32 x64"
; userconfig C:\Users\16334\.npmrc
cache = "D:\\AllTools\\nodejs\\node_cache"
prefix = "D:\\AllTools\\nodejs\\node_global"
proxy = false
registry = "https://registry.npm.taobao.org/"
; builtin config undefined
; node bin location = d:\AllTools\nodejs\node.exe
; cwd = d:\AllTools\nodejs
; HOME = C:\Users\16334
; "npm config ls -l" to show all defaults.
d:\AllTools\nodejs>npm i element-ui -S
npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
> core-js@2.6.12 postinstall d:\AllTools\nodejs\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm WARN saveError ENOENT: no such file or directory, open 'd:\AllTools\nodejs\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'd:\AllTools\nodejs\package.json'
npm WARN element-ui@2.15.10 requires a peer of vue@^2.5.17 but none is installed. You must install peer dependencies yourself.
npm WARN nodejs No description
npm WARN nodejs No repository field.
npm WARN nodejs No README data
npm WARN nodejs No license field.
+ element-ui@2.15.10
added 215 packages from 124 contributors and removed 216 packages in 15.866s
11 packages are looking for funding
run `npm fund` for details