nvm 未更改节点版本以符合 Strapi

问题描述 投票:0回答:1

我正在尝试在我的 api 文件夹中为电子商务网站项目创建一个新的 Strapi 项目。但是,无论我做什么尝试使用 nvm 更改节点版本,我仍然收到此错误(它与当前版本不兼容)。正如您在下面看到的,我实际上只是使用 nvm 将节点版本更改为 20.0.0,并且我得到了确认我当前正在使用它。您还可以在我的 nvm list 命令中看到 21.2.0 甚至没有安装。我很困惑,也是一个初学者。我使用nvm错误吗?我是否必须删除一些以前的文件夹,这些文件夹在某种程度上使我的项目认为我正在使用 21.2.0?我很困惑,希望得到任何帮助。

[email protected]
PS C:\Users\liamt\Desktop\ecommerce-app\api> nvm current
v20.11.0
PS C:\Users\liamt\Desktop\ecommerce-app\api> nvm ls 

    20.9.0
    20.5.0
    20.0.0
PS C:\Users\liamt\Desktop\ecommerce-app\api> nvm use 20.0.0
Now using node v20.0.0 (64-bit)
PS C:\Users\liamt\Desktop\ecommerce-app\api> npx create-strapi-app@latest .         
(node:14736) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternatiternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
? Choose your installation type Custom (manual settings)
You are running Node.js 21.2.0
Strapi requires Node.js >=18.0.0 <=20.x.x
Please make sure to use the right version of Node.
PS C:\Users\liamt\Desktop\ecommerce-app\api>

我尝试使用 nvm 更改 nod 的版本,它似乎发生了变化,但我仍然有相同的错误。

node.js terminal strapi nvm
1个回答
0
投票

我有 Photoshop,其中包含 node.exe 本身。删除 Photoshop 对我有帮助,我还删除了用户文件夹中的 node_modules。

© www.soinside.com 2019 - 2024. All rights reserved.