我是節點新手,我認為錯誤是說我的節點太新了。該站點上的其他答案是告訴如何升級他們的節點,但我如何將我的節點與包想要的節點相匹配?
C:\react>npx create-strapi-starter@3 strapi-ecomm next-ecommerce
Need to install the following packages:
create-strapi-starter@3
Ok to proceed? (y) y
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=10.16.0 <=14.x.x', npm: '>=6.0.0' },
npm WARN EBADENGINE current: { node: 'v16.13.1', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=10.16.0 <=14.x.x', npm: '>=6.0.0' },
npm WARN EBADENGINE current: { node: 'v16.13.1', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
? Choose your installation type Quickstart (recommended)
Creating a quickstart project.
Creating a new Strapi application at C:\react\strapi-ecomm\backend.
Creating files.
Installing strapi/strapi-template-ecommerce template.
Error while installing dependencies:
warning ..\..\package.json: No license field
error backend@0.1.0: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.13.1"
error Found incompatible module.
Keep trying!
Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentioned in the installation errors and try to run the following command:
cd C:\react\strapi-ecomm\backend && yarn install
C:\react>cd C:\react\strapi-ecomm\backend
C:\react\strapi-ecomm\backend>yarn install
yarn install v1.22.17
warning ..\..\package.json: No license field
info No lockfile found.
[1/5] Validating package.json...
error [email protected]: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.13.1"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
uj5u.com熱心網友回復:
選項 #1 (NVM):
您有節點v16.13.1(在 Windows 上),理想情況下該框架需要 Node 14.XX,您需要降級您的節點,或者我的建議是使用 NVM 之類的東西,可以在以下位置找到說明:
https://github.com/coreybutler/nvm-windows#install-nvm-windows
安裝后,您可以運行以下命令:
nvm install v14.18.3
然后nvm use v14.18.3最后運行您的命令并因此重置您的專案:npx create-strapi-starter@3 strapi-ecomm next-ecommerce.
如果您愿意,您還可以創建一個.nvmrc檔案并將版本 ( v14.18.3) 添加到其中,并在所需目錄中自動默認為它。
對于其他背景關系,使用 NVM 將允許您在您的機器上使用多個版本的 NodeJS。
選項#2:
從以下位置卸載 Node v16 并安裝 Node v14:https ://nodejs.org/download/release/v14.18.3/
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/418423.html
標籤:
