bash
npm ERR! code 1
npm ERR! path /Users/tal/Documents/pro/tss-console-fe/node_modules/deasync
npm ERR! command failed
npm ERR! command sh -c node ./build.js
npm ERR! CXX(target) Release/obj.target/deasync/src/deasync.o
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | darwin | arm64
npm ERR! gyp info find Python using Python version 3.9.6 found at "/Library/Developer/CommandLineTools/usr/bin/python3"
npm ERR! gyp info spawn /Library/Developer/CommandLineTools/usr/bin/python3
deasync 是一个需要 C++ 编译 的模块,它依赖于系统的编译链(如 Xcode CLI)和 node-gyp 的编译能力。你这里报错是因为缺少 头文件,说明 编译器环境不完整。
如不需要可手动移除依赖
有些项目是间接依赖 deasync 的,可以查查是不是某个插件(比如 webpack 老版本)引入的。
查看引用链:
javascript
npm ls deasync

这里我并没有用到@vue/[email protected]
所以我将@vue/[email protected] 从 package.json 中移除。问题解决!