你能帮我解决盖茨比的一个错误吗?当我使用 yarn 工作区开始开发主题时,在我的工作区上安装 Gatsby 依赖项时出现错误。看看这个。
error C:\Users\Kirito\Desktop\ninja-react\node_modules\gatsby-cli: Command failed.
Exit code: 1
Command: node scripts/postinstall.js
Arguments:
Directory: C:\Users\Kirito\Desktop\ninja-react\node_modules\gatsby-cli
Output:
internal/modules/cjs/loader.js:311
throw err;
Error: Cannot find module 'project_folder\node_modules\chalk\source'.
我的环境:节点 14.15.0 - Yarn 1.22.11。
我在根目录下的 json 包:
{
"workspaces": [
"sites/theme-dev",
"packages/gatsby-theme-docs"
],
"private": true
}
我完成了正常安装react和react-dom,但与盖茨比有冲突。
{
"name": "theme-dev",
"version": "1.0.0",
"license": "MIT",
"main": "index.js",
"private": true,
"dependencies": {
"react": "^17.0.2",
"react-dom": "^17.0.2"
}
}