微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

VS Code纱线安装错误:命令:node-gyp重建,目录:/ vscod / node_modules / native-watchdog

如何解决VS Code纱线安装错误:命令:node-gyp重建,目录:/ vscod / node_modules / native-watchdog

使用yarn install生成VS Code会引发“ node-gyp rebuild”错误

  • VS代码版本:1.50.0
  • 操作系统:macOS 10.15.7
  • Node.JS,x64,版本v12.19.0
  • 纱线版本​​1.22.10
  • Xcode版本12.0.1
  • Python版本2.7.16

以下错误

public class Main {
    static String distances(int x,int y,int z) {
        int distanceA = Math.abs(z-x);
        int distanceB = Math.abs(z-y);
        
        if(distanceB > distanceA) { 
            return "distance A";
        }
        else if(distanceB < distanceA) {
            return "distance B";
        }       
        else if(distanceB == distanceA) {
            return "distance C";
        }
    }
}

在这个问题上工作了几个小时。 Node-gyp真的很痛苦!

解决方法

解决方案:

如果出现问题,请尝试先删除〜/ .node-gyp的内容(对于Linux,则删除〜/ .cache / node-gyp;对于macOS,则是〜/ Library / Caches / node-gyp /),然后运行yarn缓存干净,然后重试。

但是另一个错误出现了:

...
...
...
warning Error running install script for optional dependency: "/Users/amora/Documents/GitHub/vscode1/extensions/markdown-language-features/node_modules/fsevents: Command failed.
Exit code: 1
Command: node install
Arguments:
Directory: /Users/amora/Documents/GitHub/vscode1/extensions/markdown-language-features/node_modules/fsevents
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.6.39
node-pre-gyp info using node@12.19.0 | darwin | x64
node-pre-gyp info check checked for \"/Users/amora/Documents/GitHub/vscode1/extensions/markdown-language-features/node_modules/fsevents/lib/binding/Release/electron-v9.2-darwin-x64/fse.node\" (not found)
node-pre-gyp http GET https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz
node-pre-gyp http 404 https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and electron@9.2.1 (electron-v9.2 ABI,unknown) (falling back to source compile with node-gyp)
node-pre-gyp http 404 status code downloading tarball https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz
node-pre-gyp ERR! Tried to download(undefined): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.1.3/fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for fsevents@1.1.3 and electron@9.2.1 (electron-v9.2 ABI,unknown) (falling back to source compile with node-gyp)
node-pre-gyp http Connection closed while downloading tarball file
...
...
...

尝试了很多次,包括检查网络。

无法下载fse-v1.1.3-electron-v9.2-darwin-x64.tar.gz

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。