【问题标题】:npm install error. node js? fsevents? Xcode? Or another problem? [duplicate]npm 安装错误。节点js?事件?代码?还是其他问题? [复制]
【发布时间】:2020-11-07 18:21:00
【问题描述】:

下午好。朋友们!请帮忙。有一个错误。我运行npm install 命令,这个问题崩溃了:

natalakolivosko@192 webpack-static-template % npm install

> fsevents@1.2.13 install /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/watchpack-chokidar2/node_modules/fsevents
> node install.js

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:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/watchpack-chokidar2/node_modules/fsevents
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

> fsevents@1.2.13 install /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/webpack-dev-server/node_modules/fsevents
> node install.js

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:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/webpack-dev-server/node_modules/fsevents
gyp ERR! node -v v12.18.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 

> node-sass@4.14.1 install /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/node-sass
> node scripts/install.js

Cached binary found at /Users/natalakolivosko/.npm/node-sass/4.14.1/darwin-x64-72_binding.node

> node-sass@4.14.1 postinstall /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/node-sass
> node scripts/build.js

Binary found at /Users/natalakolivosko/Documents/JM/wc_CPS_block16/webpack-static-template/node_modules/node-sass/vendor/darwin-x64-72/binding.node
Testing binary
Binary is fine
npm WARN webpack-test@1.0.0 No repository field.

added 959 packages from 489 contributors and audited 959 packages in 27.986s

28 packages are looking for funding
  run `npm fund` for details

found 215 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

我尝试使用link 再次卸载并安装node js。我还尝试通过npm install fsevents 再次安装fsevents

很遗憾,这并没有带来任何结果。

请告诉我问题是什么以及如何解决?

如果您还有任何问题,请告诉我,我会回答。

附言我有 macOS。

【问题讨论】:

  • 这可能是 npm/node 版本的问题。并使用 nvm 安装 nodejs
  • 我成功了,它有助于重新安装 Xcode。

标签: node.js macos npm npm-install fsevents


【解决方案1】:

Ciao,根据this 的文章,您必须通过删除以前安装的版本来重新安装命令行工具。简而言之:

  1. 查找命令行工具的安装位置:

     xcode-select --print-path
    
  2. 删除它:

    sudo rm -r -f /path/found/onprevious/step
    
  3. 重新安装:

    xcode-select --install
    

注意:文章指的是 macOS Catalina。

【讨论】:

  • 是的,谢谢你亲爱的朋友。我昨天自己找到了这篇文章并解决了这个问题。但是谢谢你,因为如果我没有找到这篇文章,你的回答会对我有所帮助。谢谢!))
  • 没问题。很高兴听到你解决它。祝你有美好的一天:)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2019-08-20
  • 1970-01-01
  • 2017-06-08
  • 2016-05-03
相关资源
最近更新 更多