0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

npmでsha512エラーやEINTEGRITYエラーが起きるときの対処方

Posted at

エラー内容

bash
~/my-ripository$ npm i
npm warn deprecated @humanwhocodes/config-array@0.13.0: Use @eslint/config-array instead
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn tarball tarball data for is-typed-array@https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz seems to be corrupted. Trying again.
npm warn tarball tarball data for is-weakset@https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz seems to be corrupted. Trying again.
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated eslint@8.57.1: This version is no longer supported. Please see https://eslint.org/version-support for other options.
npm warn tarball tarball data for is-typed-array@https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz seems to be corrupted. Trying again.
npm warn tarball tarball data for is-weakset@https://registry.npmjs.org/is-weakset/-/is-weakset-2.0.3.tgz seems to be corrupted. Trying again.
npm warn cleanup Failed to remove some directories [
npm warn cleanup   [
npm warn cleanup     '/home/username/repository/project-name/node_modules/is-weakset',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/home/username/repository/project-name/node_modules/is-weakset'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/home/username/repository/project-name/node_modules/is-weakset'
npm warn cleanup   ],
npm warn cleanup   [
npm warn cleanup     '/home/username/repository/project-name/node_modules',
npm warn cleanup     [Error: ENOTEMPTY: directory not empty, rmdir '/home/username/repository/project-name/node_modules/is-weakset'] {
npm warn cleanup       errno: -39,
npm warn cleanup       code: 'ENOTEMPTY',
npm warn cleanup       syscall: 'rmdir',
npm warn cleanup       path: '/home/username/repository/project-name/node_modules/is-weakset'
npm warn cleanup   ]
npm warn cleanup ]
npm error code EINTEGRITY
npm error sha512 checksum failed when using sha512: wanted sha512-... but got sha512-... (bytes)
npm error A complete log of this run can be found in: /home/username/.npm/_logs/debug-0.log

エラーの最後は長いので省略しています。

発現状況

  1. Windows 11で直にnpx create-next-app@latest [project-name] [options]をし、Next.jsのプロジェクトの開発
  2. WSL Ubuntu 24.04.1 LTS環境での開発に切り替えたくなる。
  3. SSHでリポジトリをクローン
  4. リポジトリディレクトリでnpm installを実行→エラー

解決策

この方法だと完全に以前と同じバージョンのパッケージを読み込めるとは限りません。
package.jsonに書かれたものを参考にインストールされるため、バージョンにズレが生じる可能性があります。

理解してから行動したい人は以下をおすすめします。

package.jsonとpackage-lock.jsonのバージョン指定や必要性について

package-lock.jsonを削除

bash
npm install

を実行。



EINTEGRITYを日本語訳すると「誠実」という意味らしい。誠実エラー。

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?