正如标题所说,我尝试了阳光下的一切。删除/更新 NPM/node(包括文件夹 package-lock)、删除每个包、启动新文件夹、更改所有全局设置、更新所有全局设置。 (缓存清理/缓存验证)。更新了所有必需的插件
警告消息:
无论我位于全局文件夹还是新文件夹中,仍然收到相同的警告。是的,我有最新的 NPM,是的,我有管理员访问权限,是的,npm 中的全局更改显示了 js-core3,例如,但是当尝试运行 npm gatsby install 时仍然给我一个错误,说我正在运行旧版本js 核心。谁能帮助我?我在 PC 上,我只是想获取 gatsby YT 上显示的设置并运行命令 gatsby,但它不起作用
最佳答案
您需要适合some pre-requisites在您的计算机中安装 Gatsby,如果使用 Windows,还需要进行一些细微的调整。
确保您已安装 Node
确保您已安装 Git
全局安装 Gatsby-cli:
npm install -g gatsby-cli
通过以下方式确保其正常工作:
gatsby --help
在 Windows ,您可能需要添加:
npm install --global windows-build-tools --vs2015
安装全局依赖项时,请确保关闭并重新打开终端以删除缓存。
The term 'gatsby' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1
您可能会在 this GitHub thread 中找到一些解决方法.
关于 Gatsby 未安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64014280/