EM_*_*Dev 5 javascript node.js npm node-modules
每当我在新计算机上的项目上运行“npm install”命令时,都会出现一些奇怪的行为。安装命令完成后,我的 node_modules 文件夹就会消失。任何帮助表示赞赏!
这是日志:
PS C:\Dev\eth> npm i
npm WARN deprecated truffle-hdwallet-provider@0.0.3: WARNING: This package has been renamed to @truffle/hdwallet-provider.
npm WARN deprecated uuid@3.3.2: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now,
please switch to that.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-block@2.2.2: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated multibase@0.7.0: This module has been superseded by the multiformats module
npm WARN deprecated multibase@0.6.1: This module has been superseded by the multiformats module
npm WARN deprecated ethereumjs-tx@2.1.2: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated multicodec@0.5.7: This module has been superseded by the multiformats module
npm WARN deprecated multicodec@1.0.4: This module has been superseded by the multiformats module
npm WARN deprecated ethereumjs-tx@1.3.7: New package name format for new versions: @ethereumjs/tx. Please update.
npm WARN deprecated ethereumjs-vm@2.6.0: New package name format for new versions: @ethereumjs/vm. Please update.
npm WARN deprecated ethereumjs-block@1.7.1: New package name format for new versions: @ethereumjs/block. Please update.
npm WARN deprecated ethereumjs-common@1.5.2: New package name format for new versions: @ethereumjs/common. Please update.
npm WARN deprecated cids@0.7.5: This module has been superseded by the multiformats module
npm WARN tarball tarball data for bignumber.js@git+ssh://git@github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2 (sha512-rjbVI8RX9gb0ly+xdEF9qu6Xq7c8uAurfHK7nt/sAtyYKdv7zKYv9zGk/dg+Ofyy+rgdDYpp1qIsI19pubVjAg==) seems to be corrupted. Trying again.
npm WARN tarball tarball data for bignumber.js@git+ssh://git@github.com/debris/bignumber.js.git#94d7146671b9719e00a09c29b01a691bc85048c2 (sha512-rjbVI8RX9gb0ly+xdEF9qu6Xq7c8uAurfHK7nt/sAtyYKdv7zKYv9zGk/dg+Ofyy+rgdDYpp1qIsI19pubVjAg==) seems to be corrupted. Trying again.
npm ERR! code EINTEGRITY
npm ERR! sha512-rjbVI8RX9gb0ly+xdEF9qu6Xq7c8uAurfHK7nt/sAtyYKdv7zKYv9zGk/dg+Ofyy+rgdDYpp1qIsI19pubVjAg== integrity checksum failed when using sha512: wanted sha512-rjbVI8RX9gb0ly+xdEF9qu6Xq7c8uAurfHK7nt/sAtyYKdv7zKYv9zGk/dg+Ofyy+rgdDYpp1qIsI19pubVjAg== but got sha512-k55rLoPK7DNCwjO/+Esh5n3lNF+lKwzfIIak1alqxXhrXsInC69JJKwEjAyCB8+IehSFkObzxzzu9URR+Q4pyA==. (63471 bytes)
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ericm\AppData\Local\npm-cache\_logs\2021-09-14T17_35_53_844Z-debug.log
Run Code Online (Sandbox Code Playgroud)
PS C:\Dev\eth>
您可能缓存了一个包,但校验和比较失败,您可以尝试:
$ cd <project_directory>
$ rm -rf package-lock.json npm-shrinkwrap.json node_modules
$ npm cache clean --force
$ npm cache verify
$ npm install
Run Code Online (Sandbox Code Playgroud)
或者看这里:当我运行“npm install”时,它返回“ERR!” 代码 EINTEGRITY` (npm 5.3.0)
由于您正在使用 Crypto 构建某些内容,因此我会格外小心,并确保这实际上只是一个错误/误报,而不是未通过校验和的恶意包。后者的可能性非常低,但我会在这一步多加注意。