web-dev-qa-db-ja.com

Mac OS Catalinaにnpmパッケージ(fsevents)をインストールできません

このコマンドをnpm install express --saveを実行すると、エラーが発生します。誰かがこの問題を助けてくれますか?

エラー:

> [email protected] install /Users/delowar/Desktop/ytdl/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

No receipt for 'com.Apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.Apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.Apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/Cellar/node/13.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/delowar/Desktop/ytdl/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v13.7.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

> [email protected] install /Users/delowar/Desktop/ytdl/node_modules/jest-haste-map/node_modules/fsevents
> node-gyp rebuild

No receipt for 'com.Apple.pkg.CLTools_Executables' found at '/'.

No receipt for 'com.Apple.pkg.DeveloperToolsCLILeo' found at '/'.

No receipt for 'com.Apple.pkg.DeveloperToolsCLI' found at '/'.

gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:321:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/Cellar/node/13.7.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/delowar/Desktop/ytdl/node_modules/jest-haste-map/node_modules/fsevents
gyp ERR! node -v v13.7.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN [email protected] requires a peer of TypeScript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

スクリーンショット: enter image description here

1
Delowar Hosain

Xcodeコマンドラインツールを再インストールすることで問題が解決しました。

ターミナルを開き、次のコードを貼り付けます。

Sudo rm -rf /Library/Developer/CommandLineTools

その後

xcode-select --install

注:-rmコマンドの使用には注意してください

9
Delowar Hosain

私はrm -rfコマンドを使用したくないので、ターミナルで実行できる「ゴミ箱」式を使用してインストールした場合の代替オプションは次のとおりです。

trash Library/Developer/CommandLineTools

その後

xcode-select --install

ごみ箱がインストールされていない場合は、ターミナルで実行できます。 https://formulae.brew.sh/formula/trash

brew install trash
0
Rebien Kani