gpt4 book ai didi

node.js - 设置 SharePoint 框架开发环境时出现错误 "Your yo version is outdated"

转载 作者:太空宇宙 更新时间:2023-11-04 01:43:46 25 4
gpt4 key购买 nike

我正在 Windows 7 x64 中设置 SharePoint 框架开发环境,如本视频中所述:

https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment

我成功安装了 Node.js + VS Code,现在我正处于安装 yo 包的阶段,使用以下命令:

npm install -g yo gulp

但是我收到错误“Your yo version is outdated”,如下所示:

V Global configuration file is valid
V NODE_PATH matches the npm root
V Node.js version
V No .bowerrc file in home directory
V No .yo-rc.json file in home directory
× yo version

Your yo version is outdated.

Upgrade to the latest version by running:
npm install -g yo@latest

V npm version

Found potential issues on your machine :(
+ gulp@3.9.1
+ yo@2.0.5
added 787 packages in 229.024s

所以我运行了这个命令来升级yo:

npm install -g yo@latest

但我遇到了同样的错误:

Running sanity checks on your system

V Global configuration file is valid
V NODE_PATH matches the npm root
V Node.js version
V No .bowerrc file in home directory
V No .yo-rc.json file in home directory
× yo version

Your yo version is outdated.

Upgrade to the latest version by running:
npm install -g yo@latest

V npm version

Found potential issues on your machine :(
+ yo@2.0.5
updated 1 package in 38.439s

我还尝试运行这些命令:

npm rm -g yo
npm install -g yo

但他们没有修复任何问题。

当我想打开yo时,如下所示,又出现了一个错误:

PS C:\Users\*****> yo @microsoft/sharepoint
yo : The term 'yo' 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
+ yo @microsoft/sharepoint
+ ~~
+ CategoryInfo : ObjectNotFound: (yo:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

谁能给点建议吗?

最佳答案

修复了 Windows 10/x64 上的相同问题,尽管我安装的 Nodejs 是非标准的“C:\nodejs\”。我将 NODE_PATH 修复为

c:\nodejs;c:\nodejs\node_modules\npm\node_modules"

和要包含的路径

c:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;
c:\nodejs\node_modules\npm\node_modules\windows-build-tools\node_modules\.bin;
c:\nodejs\node_modules\npm\;
c:\nodejs;

也许问题在于你的医生无法找到自己

关于node.js - 设置 SharePoint 框架开发环境时出现错误 "Your yo version is outdated",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52175336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com