[英]Cannot install npm package (fsevents) on Mac OS Catalina
When I run npm install express --save
this command, I'm getting an error.当我运行npm install express --save
这个命令时,我收到一个错误。 Can anyone please help me with this issue?任何人都可以帮我解决这个问题吗?
Error:错误:
> fsevents@1.2.11 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
> fsevents@1.2.11 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 tsutils@3.17.1 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: fsevents@1.2.11 (node_modules/chokidar/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
Problem solved by reinstalling xcode command line tools.问题通过重新安装 xcode 命令行工具解决。
Open Terminal & paste these code:打开终端并粘贴这些代码:
sudo rm -rf /Library/Developer/CommandLineTools
then然后
xcode-select --install
Note: - Be Careful using
rm
command注意: - 小心使用rm
命令
I don't like to use the rm -rf command so an alternative option when you have brew installed with the "trash" formulae you can do on your terminal is :我不喜欢使用 rm -rf 命令,因此当您使用“垃圾”公式安装 brew 时,您可以在终端上执行的替代选项是:
trash Library/Developer/CommandLineTools
And then进而
xcode-select --install
If you don't have trash installed then you can do it on your terminal : https://formulae.brew.sh/formula/trash如果你没有安装垃圾,那么你可以在你的终端上进行: https : //formulae.brew.sh/formula/trash
brew install trash
For me the instructions above didn't work.对我来说,上面的说明不起作用。 So, I came across a different solution:所以,我遇到了一个不同的解决方案:
> xcode-select -print-path /Library/Developer/CommandLineTools
> sudo xcode-select --reset
> xcode-select -print-path /Applications/Xcode.app/Contents/Developer
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.