Npm intall reported an error

use gitbash to install the project
use vue init webpack myapp to create the project. After creation, you need to install the dependency package
, but execute npm install and find that the following occurs first

$ npm install
npm WARN deprecated @types/commander@2.12.2: This is a stub types definition for                                                    commander (https://github.com/tj/commander.js). commander provides its own type                                                    definitions, so you don"t need @types/commander installed!

has been stuck in this situation since then, and the error is reported after a long time, which is shown as the following situation

npm ERR! code EINTEGRITY
npm ERR! sha512-+CCi1ED+7f36xpeGUqB8bWHde0To+9ZtegBHwWkbd9NsZcvANrtr8wlRNqHSD8yG                                                   mC0F7rixbgwiJEK9mTCLww== integrity checksum failed when using sha512: wanted sha                                                   512-+CCi1ED+7f36xpeGUqB8bWHde0To+9ZtegBHwWkbd9NsZcvANrtr8wlRNqHSD8yGmC0F7rixbgwi                                                   JEK9mTCLww== but got sha512-ahSQkyT17YkZhke+ZXY6Uk3y2cCI6RwKwZldy9Icav5G6VjwseA6                                                   ncOB3ggrJSIFGk2FWmmk0KXD9RXCM/cMZg==. (9173629 bytes)

what is wrong with this? How to solve it?

Jul.18,2021

remove pack-lock.json, and try again.
you can also refer to this

this'@ types/commander@2.12.2'is obsolete. Commander has provided type definitions, so there is no need to install @ types/commander


.

my problem should not be caused by the file or version, because the project has been created under the same configuration, and because there has been stutters for a long time in the process, so I think it is because of the npm timeout, so I use

.
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install

change to Taobao image to install, and find that the installation is successful, so you can try cnpm

when you stutter for a long time.
Menu