strapi / documentation

Strapi Documentation
https://docs.strapi.io
Other
1.01k stars 1.08k forks source link

[Bug]: Node18 + yarn/npm installation issue #1438

Closed jeetvora331 closed 9 months ago

jeetvora331 commented 1 year ago

Link to the documentation page or resource

https://docs.strapi.io/developer-docs/latest/setup-deployment-guides/installation/cli.html#preparing-the-installation:~:text=versions%20are%20supported-,(v14%2C%20v16%2C%20and%20v18),-.

Describe the bug

TL;DR - strapi quick start installation creates conflict with node.js version 18. So I believe there is a bug in the documentation regarding support of nodejs version 18.

Installing strapi with CLI command: npx create-strapi-app@latest my-project , generates errors. After trying to debug the errors, and trying many ways, I found that the conflict was due to my version of nodejs. I downgraded my latest nodejs version (18.13.0 LTS) to 16.14.1 and it worked fine. The documentation describes that strapi works fine with nodejs version 18.

Additional context

No response

Suggested improvements or fixes

To fix the issue I downgraded my node version to version 16.14.1 using nvm

Related issue(s)/PR(s)

No response

stb13579 commented 1 year ago

@jeetvora331 Thanks for the bug report. Are you using yarn or npm? Did the application install at all with node18 or error out right away? Thanks again, we will get this fixed asap.

jeetvora331 commented 1 year ago

Hello, I am using npm as my primary package manager. Moreover, I tried to install multiple times but it gives error : Couldn't install dependencies while setting up strapi project, and if I still try to start the server it shows the error "Error: knex: Required configuration option 'client' is missing."

stb13579 commented 1 year ago

I am very sorry you are having an issue installing Strapi. I am going to pass your issue to our developers since I don't think it can be solved in the documentation. I will keep this issue open though, for when we have more information.

jeetvora331 commented 1 year ago

Sure! Thankyou for your support.

findborg commented 1 year ago

Having the same problem on a windows machine.

stb13579 commented 1 year ago

Having the same problem on a windows machine.

@findborg could you share the error message? I worked on an issue with yarn late last week, but I am still researching for the issue with the npx command.

MahmoudAFarag commented 1 year ago

I had the same issue with Node 18 LTS, its turns out that better-sqlite 7.4.6 does not support Node 18. Therefore pumping the version of better-sqlite to 8.2.0 before installation fixed the issue

mr-moon commented 1 year ago

I have same problems executing commands from the docs:

$ > npx create-strapi-app@latest test--quickstart

Need to install the following packages:
  create-strapi-app@4.9.0
Ok to proceed? (y) 
Creating a quickstart project.
Creating a new Strapi application at /Users/moon/test.
Creating files.
Error while installing dependencies:

 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 /Users/moon/test && yarn install
v16.17.0
pbonneville-nyt commented 1 year ago

I have same problems executing commands from the docs:

$ > npx create-strapi-app@latest test--quickstart

Need to install the following packages:
  create-strapi-app@4.9.0
Ok to proceed? (y) 
Creating a quickstart project.
Creating a new Strapi application at /Users/moon/test.
Creating files.
Error while installing dependencies:

 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 /Users/moon/test && yarn install
v16.17.0

I'm getting the same issue, using 18.6.0 . When you jump into the project folder and yarn install, this is what I get:

% yarn install
➤ YN0000: ┌ Resolution step
➤ YN0060: │ @strapi/admin@npm:4.9.2 [fecea] provides typescript (pfe5f3) with version 4.6.2, which doesn't satisfy what react-intl and some of its descendants request
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [96687] doesn't provide @codemirror/view (p6de0c), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [d4db9] doesn't provide @codemirror/view (p063c8), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react (p77903), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react (p4f98a), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react (p3b01f), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-dom (p8c18d), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-dom (p6232a), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-dom (p36350), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-router-dom (p3efa6), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-router-dom (p6458c), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide react-router-dom (pbaacf), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide styled-components (pb1e86), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide styled-components (pdb1f7), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.9.2 doesn't provide styled-components (pcd663), requested by @strapi/plugin-upload
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react (p7736e), requested by @strapi/plugin-i18n
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react (pe591e), requested by @strapi/plugin-users-permissions
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react-dom (pda2c0), requested by @strapi/plugin-i18n
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react-dom (pf623f), requested by @strapi/plugin-users-permissions
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react-router-dom (p0ebda), requested by @strapi/plugin-i18n
➤ YN0002: │ grain-exchange@workspace:. doesn't provide react-router-dom (pa7d81), requested by @strapi/plugin-users-permissions
➤ YN0002: │ grain-exchange@workspace:. doesn't provide styled-components (p942e5), requested by @strapi/plugin-i18n
➤ YN0002: │ grain-exchange@workspace:. doesn't provide styled-components (p98f77), requested by @strapi/plugin-users-permissions
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 267ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 0s 407ms
➤ YN0000: ┌ Link step
➤ YN0007: │ better-sqlite3@npm:8.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ sharp@npm:0.32.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.30.1 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.16.17 must be built because it never has been before or the last one failed
➤ YN0007: │ @strapi/strapi@npm:4.9.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 4s 160ms
➤ YN0000: Done with warnings in 5s 22ms
tention commented 1 year ago

Faced the same problem. Managed to kick start Strapi manually using yarn install and yarn start.

my-project % yarn start

 Project information

┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Thu Apr 27 2023 16:30:17 GMT+0800 (Malaysia Tim… │
│ Launched in        │ 648 ms                                           │
│ Environment        │ development                                      │
│ Process PID        │ 77795                                            │
│ Version            │ 4.10.1 (node v18.16.0)                           │
│ Edition            │ Community                                        │
│ Database           │ sqlite                                           │
└────────────────────┴──────────────────────────────────────────────────┘

 Actions available

Welcome back!
To manage your project 🚀, go to the administration panel at:
http://localhost:1337/admin

To access the server ⚡️, go to:
http://localhost:1337

However, triggering Strapi in development mode using yarn develop failed with the following errors

my-project % yarn develop
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: @strapi/admin tried to access react-router, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: react-router
Required by: @strapi/admin@virtual:09ad5965c2f8c461b068cc0889f74415d05c7c29c2e0ffe8a079c354cb517bcb566ea03039654b2ed3b3a06c48bf89de37d814643605da40f3da2f8bdef85e25#npm:4.10.1 (via /Users/teeyensheng/Projects/my-project/.yarn/__virtual__/@strapi-admin-virtual-0dddf57e4e/0/cache/@strapi-admin-npm-4.10.1-9069f3a2d0-bb942f2de8.zip/node_modules/@strapi/admin/)
liudonghua123 commented 1 year ago

I have the same problems when install on alamlinux 9.1 which has node 18.

[root@localhost ~]# npx create-strapi-app@latest strapi
Need to install the following packages:
  create-strapi-app@4.10.2
Ok to proceed? (y) y
? Choose your installation type Quickstart (recommended)
Creating a quickstart project.
Creating a new Strapi application at /root/strapi.
Creating files.
Error while installing dependencies:

 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 /root/strapi && yarn install

[root@localhost ~]# cd /root/strapi && yarn install
➤ YN0000: ┌ Resolution step
➤ YN0032: │ better-sqlite3@npm:8.0.1: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ formidable@npm:1.2.6 is deprecated: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
➤ YN0061: │ @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
➤ YN0032: │ sharp@npm:0.32.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ node-addon-api@npm:6.1.0: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ source-map-resolve@npm:0.5.3 is deprecated: See https://github.com/lydell/source-map-resolve#deprecated
➤ YN0061: │ urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
➤ YN0061: │ resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
➤ YN0061: │ source-map-url@npm:0.4.1 is deprecated: See https://github.com/lydell/source-map-url#deprecated
➤ YN0061: │ mailcomposer@npm:3.12.0 is deprecated: This project is unmaintained
➤ YN0061: │ buildmail@npm:3.10.0 is deprecated: This project is unmaintained
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [c73f8] doesn't provide @codemirror/view (pff790), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [dd35c] doesn't provide @codemirror/view (p43a44), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p59c51), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (pb4a3c), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p256ea), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p611ff), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p551b5), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (pc85de), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (p25ad3), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pd2072), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pabf37), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p5f919), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p27a7f), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (pd68f3), requested by @strapi/plugin-upload
➤ YN0002: │ strapi@workspace:. doesn't provide react (p8162d), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react (p16f2f), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p9a49c), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p968ce), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p07ad8), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p5c046), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p06870), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p15846), requested by @strapi/plugin-users-permissions
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 20s 577ms
➤ YN0000: ┌ Fetch step
➤ YN0013: │ ylru@npm:1.3.2 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yocto-queue@npm:0.1.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yup@npm:0.32.11 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ yup@npm:0.32.9 can't be found in the cache and will be fetched from the remote registry
➤ YN0013: │ typescript@npm:5.0.4 can't be found in the cache and will be fetched from the remote registry
➤ YN0000: └ Completed in 36s 557ms
➤ YN0000: ┌ Link step
➤ YN0031: │ One or more node_modules have been detected and will be removed. This operation may take some time.
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ core-js-pure@npm:3.30.2 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.16.17 must be built because it never has been before or the last one failed
➤ YN0007: │ sharp@npm:0.32.0 must be built because it never has been before or the last one failed
➤ YN0007: │ better-sqlite3@npm:8.0.1 must be built because it never has been before or the last one failed
➤ YN0009: │ sharp@npm:0.32.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-6af15072/build.log)
➤ YN0007: │ @strapi/strapi@npm:4.10.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1m 3s
➤ YN0000: Failed with errors in 1m 60s
[root@localhost strapi]# echo $?
1
[root@localhost strapi]# npm -v
8.19.2
[root@localhost strapi]# node -v
v18.12.1
[root@localhost strapi]# yarn -v
3.5.1
[root@localhost strapi]# cat /etc/os-release 
NAME="AlmaLinux"
VERSION="9.1 (Lime Lynx)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.1"
PLATFORM_ID="platform:el9"
PRETTY_NAME="AlmaLinux 9.1 (Lime Lynx)"
ANSI_COLOR="0;34"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:almalinux:almalinux:9::baseos"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"

ALMALINUX_MANTISBT_PROJECT="AlmaLinux-9"
ALMALINUX_MANTISBT_PROJECT_VERSION="9.1"
REDHAT_SUPPORT_PRODUCT="AlmaLinux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.1"
[root@localhost strapi]#
liudonghua123 commented 1 year ago

I noticed this line sharp@npm:0.32.0 couldn't be built successfully (exit code 1, logs can be found here: /tmp/xfs-6af15072/build.log).

[root@localhost strapi]# cat /tmp/xfs-6af15072/build.log
# This file contains the result of Yarn building a package (sharp@npm:0.32.0)
# Script name: install

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.2/libvips-8.14.2-linux-x64.tar.br
sharp: Integrity check passed for linux-x64
prebuild-install warn install Request timed out
gyp info it worked if it ends with ok
gyp info using node-gyp@9.3.1
gyp info using node@18.12.1 | linux | x64
gyp info find Python using Python version 3.11.0 found at "/usr/local/bin/python3"
gyp http GET https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v18.12.1/node-v18.12.1-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v18.12.1/SHASUMS256.txt
gyp info spawn /usr/local/bin/python3
gyp info spawn args [
gyp info spawn args   '/root/strapi/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/root/strapi/.yarn/unplugged/sharp-npm-0.32.0-151cbbd0bb/node_modules/sharp/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/strapi/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/root/.cache/node-gyp/18.12.1/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/root/.cache/node-gyp/18.12.1',
gyp info spawn args   '-Dnode_gyp_dir=/root/strapi/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/root/.cache/node-gyp/18.12.1/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/root/strapi/.yarn/unplugged/sharp-npm-0.32.0-151cbbd0bb/node_modules/sharp',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory '/root/strapi/.yarn/unplugged/sharp-npm-0.32.0-151cbbd0bb/node_modules/sharp/build'
  CC(target) Release/obj.target/nothing/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.o
rm -f Release/obj.target/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.a Release/obj.target/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.a.ar-file-list; mkdir -p `dirname Release/obj.target/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.a`
ar crs Release/obj.target/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.a @Release/obj.target/../../../node-addon-api-npm-6.1.0-634c545b39/node_modules/node-addon-api/nothing.a.ar-file-list
  COPY Release/nothing.a
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp-linux-x64/src/common.o
../src/common.cc:13:10: fatal error: vips/vips8: No such file or directory
   13 | #include <vips/vips8>
      |          ^~~~~~~~~~~~
compilation terminated.
make: *** [sharp-linux-x64.target.mk:135: Release/obj.target/sharp-linux-x64/src/common.o] Error 1
make: Leaving directory '/root/strapi/.yarn/unplugged/sharp-npm-0.32.0-151cbbd0bb/node_modules/sharp/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/root/strapi/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/lib/build.js:203:23)
gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Linux 5.14.0-162.23.1.el9_1.x86_64
gyp ERR! command "/usr/bin/node" "/root/strapi/.yarn/unplugged/node-gyp-npm-9.3.1-43540bab9c/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/strapi/.yarn/unplugged/sharp-npm-0.32.0-151cbbd0bb/node_modules/sharp
gyp ERR! node -v v18.12.1
gyp ERR! node-gyp -v v9.3.1
gyp ERR! not ok 
[root@localhost strapi]#

The error may come from ../src/common.cc:13:10: fatal error: vips/vips8: No such file or directory.

see also https://github.com/lovell/sharp/issues/1882.

liudonghua123 commented 1 year ago

I tried to build/install libvips manually on my almalinux 9.1 which does not hava libvips prebuilt binary. Then the error of ../src/common.cc:13:10: fatal error: vips/vips8: No such file or directory disappeared when I tried to install sharp. After libvips installed on the system, the header files such as vips/vips8 exists. The sharp dependence could installed successfully.

See also https://github.com/libvips/libvips/issues/1434#issuecomment-1538033158, https://www.libvips.org/install.html#building-libvips-from-source.

[root@localhost strapi]# yarn
➤ YN0000: ┌ Resolution step
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [c73f8] doesn't provide @codemirror/view (pff790), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [dd35c] doesn't provide @codemirror/view (p43a44), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p59c51), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (pb4a3c), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p256ea), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p611ff), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p551b5), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (pc85de), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (p25ad3), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pd2072), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pabf37), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p5f919), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p27a7f), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (pd68f3), requested by @strapi/plugin-upload
➤ YN0002: │ strapi@workspace:. doesn't provide react (p8162d), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react (p16f2f), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p9a49c), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p968ce), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p07ad8), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p5c046), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p06870), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p15846), requested by @strapi/plugin-users-permissions
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 0s 796ms
➤ YN0000: ┌ Fetch step
➤ YN0000: └ Completed in 1s 28ms
➤ YN0000: ┌ Link step
➤ YN0000: │ ESM support for PnP uses the experimental loader API and is therefore experimental
➤ YN0007: │ sharp@npm:0.32.0 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 25s 434ms
➤ YN0000: Done with warnings in 27s 635ms
[root@localhost strapi]# echo $?
0
[root@localhost strapi]#

You can check wether the libvips is installed via pkg-config.

[root@localhost ~]# ll /usr/local/include/vips/
total 652
drwxr-xr-x  2 root root   4096 May  8 17:08 .
drwxr-xr-x. 4 root root     36 May  8 17:08 ..
-rw-r--r--  1 root root  13133 May  8 17:00 almostdeprecated.h
-rw-r--r--  1 root root  17170 May  8 17:00 arithmetic.h
-rw-r--r--  1 root root   2712 May  8 17:00 basic.h
-rw-r--r--  1 root root   3301 May  8 17:00 buf.h
-rw-r--r--  1 root root   8047 May  8 17:00 colour.h
-rw-r--r--  1 root root  16696 May  8 17:00 connection.h
-rw-r--r--  1 root root   9787 May  8 17:00 conversion.h
-rw-r--r--  1 root root   2728 May  8 17:00 convolution.h
-rw-r--r--  1 root root   4615 May  8 17:00 create.h
-rw-r--r--  1 root root   2626 May  8 17:00 dbuf.h
-rw-r--r--  1 root root   1951 May  8 17:00 debug.h
-rw-r--r--  1 root root   3929 May  8 17:00 deprecated.h
-rw-r--r--  1 root root   9948 May  8 17:00 dispatch.h
-rw-r--r--  1 root root   2988 May  8 17:00 draw.h
-rw-r--r--  1 root root   7454 May  8 17:07 enumtypes.h
-rw-r--r--  1 root root   4374 May  8 17:00 error.h
-rw-r--r--  1 root root  29877 May  8 17:00 foreign.h
-rw-r--r--  1 root root   3659 May  8 17:00 format.h
-rw-r--r--  1 root root   1591 May  8 17:00 freqfilt.h
-rw-r--r--  1 root root   2037 May  8 17:00 gate.h
-rw-r--r--  1 root root   2566 May  8 17:00 generate.h
-rw-r--r--  1 root root   9555 May  8 17:00 header.h
-rw-r--r--  1 root root   2331 May  8 17:00 histogram.h
-rw-r--r--  1 root root  17956 May  8 17:00 image.h
-rw-r--r--  1 root root   4320 May  8 17:00 interpolate.h
-rw-r--r--  1 root root    281 May  8 17:00 intl.h
-rw-r--r--  1 root root   4551 May  8 17:00 mask.h
-rw-r--r--  1 root root   2412 May  8 17:00 memory.h
-rw-r--r--  1 root root   1927 May  8 17:00 morphology.h
-rw-r--r--  1 root root   2149 May  8 17:00 mosaicing.h
-rw-r--r--  1 root root  21522 May  8 17:00 object.h
-rw-r--r--  1 root root   5192 May  8 17:00 operation.h
-rw-r--r--  1 root root   6617 May  8 17:00 private.h
-rw-r--r--  1 root root   2155 May  8 17:00 rect.h
-rw-r--r--  1 root root   6599 May  8 17:00 region.h
-rw-r--r--  1 root root   3167 May  8 17:00 resample.h
-rw-r--r--  1 root root   3711 May  8 17:00 sbuf.h
-rw-r--r--  1 root root   1855 May  8 17:00 semaphore.h
-rw-r--r--  1 root root   1887 May  8 17:00 thread.h
-rw-r--r--  1 root root   4267 May  8 17:00 threadpool.h
-rw-r--r--  1 root root   2622 May  8 17:00 transform.h
-rw-r--r--  1 root root   7666 May  8 17:00 type.h
-rw-r--r--  1 root root  11750 May  8 17:00 util.h
-rw-r--r--  1 root root   3448 May  8 17:00 VConnection8.h
-rw-r--r--  1 root root   4424 May  8 17:00 vector.h
-rw-r--r--  1 root root   1829 May  8 17:00 VError8.h
-rw-r--r--  1 root root   1874 May  8 17:06 version.h
-rw-r--r--  1 root root   1314 May  8 17:00 video.h
-rw-r--r--  1 root root 189027 May  8 17:00 VImage8.h
-rw-r--r--  1 root root   2086 May  8 17:00 VInterpolate8.h
-rw-r--r--  1 root root  60846 May  8 17:00 vips7compat.h
-rw-r--r--  1 root root   1582 May  8 17:00 vips8
-rw-r--r--  1 root root   4793 May  8 17:00 vips.h
-rw-r--r--  1 root root   3011 May  8 17:00 VRegion8.h
[root@localhost ~]#
[root@localhost ~]# pkg-config --cflags vips
-I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/libxml2 -I/usr/include/cairo -I/usr/include/pixman-1 -pthread 
[root@localhost ~]# pkg-config --libs vips
-lvips -lgio-2.0 -lgobject-2.0 -lglib-2.0 
[root@localhost ~]#
liudonghua123 commented 1 year ago

Installing the maintained ubuntu/debian binary packages

You won't usually need to build VIPS from source on Ubuntu, just install the standard packages: sudo apt install libvips

If you also need the vips and vipsthumbnail command line tools: sudo apt install libvips-tools

If you will be doing C, C++ or python development, install the headers with: sudo apt install libvips-dev

See https://github.com/libvips/libvips/wiki/Build-for-Ubuntu

Boegie19 commented 1 year ago

@liudonghua123 would be the best way for strapi to auto install this on mac and ubuntu/debian?

liudonghua123 commented 1 year ago

However, when I try to execute yarn develop after yarn install, I got the following errors. It seems some peer dependences are not installed but required when run the app. I use yarn 3.x not the classic yarn. Maybe some peer dependences install strategy is changed or broken.

[root@localhost strapi]# yarn develop
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: @strapi/admin tried to access react-router, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: react-router
Required by: @strapi/admin@virtual:b49637f950fb2b249d6dbdfc86615354743266744687288b76a70af820ccbf661093bf37722e6b5bb7c741953f4a471b0ae738363da3679940de6f4282a65e0b#npm:4.10.2 (via /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/)

Require stack:
- /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/webpack.alias.js
- /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/webpack.config.js
- /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/utils/get-custom-webpack-config.js
- /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/utils/index.js
- /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/index.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/builders/admin.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/builders/index.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/actions/develop/action.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/utils/helpers.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/actions/admin/create-user/command.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/lib/commands/index.js
- /root/strapi/.yarn/unplugged/@strapi-strapi-npm-4.10.2-b49637f950/node_modules/@strapi/strapi/bin/strapi.js
    at require$$0.Module._resolveFilename (/root/strapi/.pnp.cjs:25903:13)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)
    at /root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/webpack.alias.js:41:46
    at Array.reduce (<anonymous>)
    at Object.<anonymous> (/root/strapi/.yarn/__virtual__/@strapi-admin-virtual-c73f804517/0/cache/@strapi-admin-npm-4.10.2-401673a6ba-dd9b53b5ea.zip/node_modules/@strapi/admin/webpack.alias.js:40:22)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at require$$0.Module._extensions..js (/root/strapi/.pnp.cjs:25947:33)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at require$$0.Module._load (/root/strapi/.pnp.cjs:25784:14)
[root@localhost strapi]# 
[root@localhost strapi]# yarn install
➤ YN0070: Migrating from Yarn 1; automatically enabling the compatibility node-modules linker 👍

➤ YN0000: ┌ Resolution step
➤ YN0032: │ better-sqlite3@npm:8.0.1: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ @npmcli/move-file@npm:2.0.1 is deprecated: This functionality has been moved to @npmcli/fs
➤ YN0032: │ fsevents@npm:2.3.2: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ formidable@npm:1.2.6 is deprecated: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
➤ YN0032: │ sharp@npm:0.32.0: Implicit dependencies on node-gyp are discouraged
➤ YN0032: │ node-addon-api@npm:6.1.0: Implicit dependencies on node-gyp are discouraged
➤ YN0061: │ source-map-resolve@npm:0.5.3 is deprecated: See https://github.com/lydell/source-map-resolve#deprecated
➤ YN0061: │ resolve-url@npm:0.2.1 is deprecated: https://github.com/lydell/resolve-url#deprecated
➤ YN0061: │ source-map-url@npm:0.4.1 is deprecated: See https://github.com/lydell/source-map-url#deprecated
➤ YN0061: │ urix@npm:0.1.0 is deprecated: Please see https://github.com/lydell/urix#deprecated
➤ YN0061: │ mailcomposer@npm:3.12.0 is deprecated: This project is unmaintained
➤ YN0061: │ buildmail@npm:3.10.0 is deprecated: This project is unmaintained
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [c73f8] doesn't provide @codemirror/view (pff790), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/design-system@npm:1.6.6 [dd35c] doesn't provide @codemirror/view (p43a44), requested by @uiw/react-codemirror
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p59c51), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (pb4a3c), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react (p256ea), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p611ff), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (p551b5), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-dom (pc85de), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (p25ad3), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pd2072), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide react-router-dom (pabf37), requested by @strapi/plugin-upload
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p5f919), requested by @strapi/plugin-content-type-builder
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (p27a7f), requested by @strapi/plugin-email
➤ YN0002: │ @strapi/strapi@npm:4.10.2 doesn't provide styled-components (pd68f3), requested by @strapi/plugin-upload
➤ YN0002: │ strapi@workspace:. doesn't provide react (p8162d), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react (p16f2f), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p9a49c), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-dom (p968ce), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p07ad8), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide react-router-dom (p5c046), requested by @strapi/plugin-users-permissions
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p06870), requested by @strapi/plugin-i18n
➤ YN0002: │ strapi@workspace:. doesn't provide styled-components (p15846), requested by @strapi/plugin-users-permissions
➤ YN0000: │ Some peer dependencies are incorrectly met; run yarn explain peer-requirements <hash> for details, where <hash> is the six-letter p-prefixed code
➤ YN0000: └ Completed in 21s 360ms
➤ YN0000: ┌ Fetch step
➤ YN0019: │ resolve-npm-1.22.3-f7dee15274-fb834b8134.zip appears to be unused - removing
➤ YN0019: │ resolve-patch-bb62d3c3c5-ad59734723.zip appears to be unused - removing
➤ YN0019: │ semver-npm-7.5.0-160502ad5d-2d26693775.zip appears to be unused - removing
➤ YN0019: │ supports-preserve-symlinks-flag-npm-1.0.0-f17c4d0028-53b1e247e6.zip appears to be unused - removing
➤ YN0019: │ terser-npm-5.17.1-5b220f4a17-69b0e80e3c.zip appears to be unused - removing
➤ YN0000: └ Completed in 5s 519ms
➤ YN0000: ┌ Link step
➤ YN0007: │ better-sqlite3@npm:8.0.1 must be built because it never has been before or the last one failed
➤ YN0007: │ sharp@npm:0.32.0 must be built because it never has been before or the last one failed
➤ YN0007: │ core-js-pure@npm:3.30.2 must be built because it never has been before or the last one failed
➤ YN0007: │ esbuild@npm:0.16.17 must be built because it never has been before or the last one failed
➤ YN0007: │ @strapi/strapi@npm:4.10.2 must be built because it never has been before or the last one failed
➤ YN0000: └ Completed in 1m 5s
➤ YN0000: Done with warnings in 1m 33s
[root@localhost strapi]#
[root@localhost strapi]# yarn explain peer-requirements p8162d
➤ YN0000: strapi@workspace:. doesn't provide react, breaking the following requirements:

➤ YN0000: @strapi/plugin-i18n@npm:4.10.2 [776fd] → ^17.0.2 ✘
[root@localhost strapi]#
[root@localhost strapi]# yarn -v
3.5.1
[root@localhost strapi]#

I also tried to use npm.

[root@localhost strapi]# npm i 
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated mailcomposer@3.12.0: This project is unmaintained
npm WARN deprecated buildmail@3.10.0: This project is unmaintained
npm WARN deprecated formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

added 1404 packages, and audited 1405 packages in 4m

134 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
[root@localhost strapi]# npm run develop

> strapi@0.1.0 develop
> strapi develop

sh: line 1: strapi: command not found
[root@localhost strapi]#
liudonghua123 commented 1 year ago

But no problems when I tried on Windows OS which use yarn 3.x too. STRANGE!

D:\code\node>yarn create strapi-app strapi-app-quickstart
yarn create v1.22.17
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "create-strapi-app@4.10.2" with binaries:
      - create-strapi-app
? Choose your installation type Quickstart (recommended)
Creating a quickstart project.
Creating a new Strapi application at D:\code\node\strapi-app-quickstart.
Creating files.
Dependencies installed successfully.
Initialized a git repository.

Your application was created at D:\code\node\strapi-app-quickstart.

Available commands in your project:

  yarn develop
  Start Strapi in watch mode. (Changes in Strapi project files will trigger a server restart)

  yarn start
  Start Strapi without watch mode.

  yarn build
  Build Strapi admin panel.

  yarn strapi
  Display all available commands.

You can start by doing:

  cd D:\code\node\strapi-app-quickstart
  yarn develop

Running your Strapi application.

> strapi-app-quickstart@0.1.0 develop
> strapi develop

Building your admin UI with development configuration...
Admin UI built successfully
[2023-05-08 10:39:54.712] info: The Users & Permissions plugin automatically generated a jwt secret and stored it in .env under the name JWT_SECRET.

 Project information

┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Mon May 08 2023 10:40:00 GMT+0800 (中国标准时间) │
│ Launched in        │ 21993 ms                                         │
│ Environment        │ development                                      │
│ Process PID        │ 4732                                             │
│ Version            │ 4.10.2 (node v18.14.2)                           │
│ Edition            │ Community                                        │
│ Database           │ sqlite                                           │
└────────────────────┴──────────────────────────────────────────────────┘

 Actions available

One more thing...
Create your first administrator 💻 by going to the administration panel at:

┌─────────────────────────────┐
│ http://localhost:1337/admin │
└─────────────────────────────┘
......
Boegie19 commented 1 year ago

@liudonghua123 this should be fixed in main already and the fix would be in the next release since the dependency on react router was removed

liudonghua123 commented 1 year ago

I tried to use npm instead of yarn from scratch. I got libvips-cpp.so.42: cannot open shared object file: No such file or directory error initially.

[root@localhost strapi-app-quickstart]# npm run develop

> strapi-app-quickstart@0.1.0 develop
> strapi develop

Building your admin UI with development configuration...
Admin UI built successfully
Error: Could not load js config file /root/strapi-app-quickstart/node_modules/@strapi/plugin-upload/strapi-server.js: 
Something went wrong installing the "sharp" module

libvips-cpp.so.42: cannot open shared object file: No such file or directory

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at loadJsFile (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:18:11)
    at loadFile (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/core/app-configuration/load-config-file.js:35:14)
    at Object.loadPlugins (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/core/loaders/plugins/index.js:103:26)
    at async Strapi.loadPlugins (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/Strapi.js:344:5)
    at async Promise.all (index 2)
    at async Strapi.register (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/Strapi.js:380:5)
    at async Strapi.load (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/Strapi.js:490:5)
    at async workerProcess (/root/strapi-app-quickstart/node_modules/@strapi/strapi/lib/commands/actions/develop/action.js:110:26)
[root@localhost strapi-app-quickstart]#

Then I tried to copy the build files libvips-cpp.so.42 andlibvips.so.42when compilelibvips` manully and configured the ldd path, see https://github.com/lovell/sharp/issues/327#issuecomment-167094002.

Now it works.

[root@localhost strapi-app-quickstart]# npm run develop

> strapi-app-quickstart@0.1.0 develop
> strapi develop

Building your admin UI with development configuration...
Admin UI built successfully

 Project information                                                          

┌────────────────────┬──────────────────────────────────────────────────┐
│ Time               │ Tue May 09 2023 10:34:41 GMT+0800 (GMT+08:00)    │
│ Launched in        │ 2136 ms                                          │
│ Environment        │ development                                      │
│ Process PID        │ 1622220                                          │
│ Version            │ 4.10.2 (node v18.12.1)                           │
│ Edition            │ Community                                        │
│ Database           │ sqlite                                           │
└────────────────────┴──────────────────────────────────────────────────┘

 Actions available                                                            

One more thing...
Create your first administrator 💻 by going to the administration panel at:

┌─────────────────────────────┐
│ http://localhost:1337/admin │
└─────────────────────────────┘

You can test sharp via node and ldd.

[root@localhost strapi-app-quickstart]# node -e "const sharp=require('sharp')"
[root@localhost strapi-app-quickstart]# ldd node_modules/sharp/build/Release/sharp-linux-x64.node 
    linux-vdso.so.1 (0x00007ffd1dbb6000)
    libvips-cpp.so.42 => /usr/local/lib/libvips-cpp.so.42 (0x00007fae7ec46000)
    libvips.so.42 => /usr/local/lib/libvips.so.42 (0x00007fae7e739000)
    libgio-2.0.so.0 => /lib64/libgio-2.0.so.0 (0x00007fae7e563000)
    libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x00007fae7e508000)
    libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x00007fae7e3ce000)
    libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fae7e1a7000)
...
[root@localhost strapi-app-quickstart]#
liudonghua123 commented 1 year ago

@liudonghua123 this should be fixed in main already and the fix would be in the next release since the dependency on react router was removed

Looking forward to use the new version of strapi. 😄

DANCAN-OMONDI-OPENJI commented 1 year ago

I had the same problem while installing strapi on node version 18.17.1 using npm and after researching for a solution online for two days, it worked for me when I used yarn create strapi-app instead of npx create-strapi-app . yarn works instead of npm in node version 18.17.1

enijar commented 11 months ago

I had this issue too. It was due to be having libvips installed via brew. I fixed this by running:

brew uninstall vips

Then running the create-strapi-app command again.

Not sure why having vips package installed causes this issue, but this is the solution to have Strapi install correctly.

pwizla commented 9 months ago

Hi! I've just tried to create a fresh project with both npx and yarn (running node 18.19.0) and had no issues 🤔 I'll close this issue for now, feel free to re-open to add additional details.

Boegie19 commented 8 months ago

@pwizla You should probebly have a section about installing sharp on mac since that is the issue here for the last 4 onces

mpstaton commented 7 months ago

Strapi needs to be clear how to install, develop, build, etc in a way that FORCES all dependencies and peer dependencies, nested dependencies, whatever. 14:19:18 ~/code/colearn/contentGraph master $ yarn start yarn run v1.22.19 warning ../../../package.json: No license field $ strapi start node:internal/modules/cjs/loader:1080 throw err; ^

Error: Cannot find module 'react' Require stack:

Node.js v18.17.0 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

pwizla commented 7 months ago

Hi @mpstaton. I'm sorry you're still having issues with installing Strapi. It seems like you could also get some help on the strapi/strapi repository. Have you already submitted an issue there? I'd be happy to help, but I'm not sure where to start and whether it's a documentation issue or a larger product issue. What is the Strapi version you're trying to install? Which node version are you running? Have you run yarn to install all dependencies such as React? Also, we've just pushed this update to the latest migration guide. Maybe it would fix your issue 🤞

mpstaton commented 7 months ago

@pwizla I'm quite sure this is a documentation issue. Yet, I'm happy to go complain on the other team's Issue board.

But really, though, the documentation should have in very specific detail:

How to retain progress on Data Schema and Database when upgrading if you need to do a hard/clean install (I may have just lost a month of progress on that., though GitHub probably will allow me to revert.)

However, the fact that the magic command line instructions do not magically install the right version of React, including the other dependencies related to React, is very weird.

I had to do a lot of guesswork to figure out that if I changed the version of Node in the packages.json file so it would take a version of Node above 18, that helped for a moment. But then the React crash again. So, I, by hand, added React and all the React subprojects that are dependencies. Then I ran install, and then it almost worked.

And then, you ready for this? I had been using Yarn, which I like better. But I think when I first installed it I used npm, and I was upgrading from the latest version last December (two months ago). So, when I was reading my package.json for the 1476th time with mind numbing detail, I noticed Yarn wasn't listed as an "engine" -- what is an engine? You should say that in your documentation. So, I just ran npm run or whatever and then my local worked like magic. All up and running!

And then, I went to Vercel and Netlify to try to deploy, and errors again!!!

And this was my favorite -- I went to deploy on Strapi Cloud, which I paid for, and ERRORS AGAIN.

Shouldn't there just be a button I click and it upgrades? WordPress does that. And I was hoping to never use WordPress again. Anyway, Strapi only has like 12 direct competitors. Happy days!

mpstaton commented 7 months ago

And @pwizla this is why God invented Docker. Why don't you have an option for a Docker image and a Dockerfile?

mpstaton commented 7 months ago

@pwizla I posted a bug to the other team.
https://github.com/strapi/strapi/issues/19438 But honestly they require so much info from me, I expect they will ignore it. Could you please send them here?

mpstaton commented 7 months ago

This is issue is not closed. Why is this marked closed?

pwizla commented 7 months ago

Hi @mpstaton, I understand your frustration and, as the Lead Technical Writer at Strapi, am happy to do anything that is under my control to help you sort this out.

Thank you for sharing your feedback! Let's try to break it bit by bit. Some of the answers you are looking for might already be in the documentation:

How to retain progress on Data Schema and Database when upgrading if you need to do a hard/clean install (I may have just lost a month of progress on that., though GitHub probably will allow me to revert.)

I'm sad to read you lost some precious time. Have you considered using Strapi's data management system (import, export, transfer)? If you need lower-level access to database migrations, you can read additional information in the database migrations documentation, but please keep in mind this is experimental stuff.

what the package.json file needs to have for both clean install and upgrade.

You shouldn't have to touch package.json for a clean install of Strapi; in this case you run the npx or yarn commands explained in the Quick Start Guide or in the CLI installation guide. When you upgrade, you indeed currently need to manually update some lines of the package.json file as explained in the Upgrade guide. In some cases, you might need to follow additional instructions that are detailed in the migration guides. As I mentioned yesterday, we've just updated the latest migration guide because there indeed were some issues with the React packages. See here (the live page is here).

how to manage plugins that have their own dependencies, therefore the command line upgrade might not catch everything.

This is something we will report to the Product & Engineering teams. The Strapi ecosystem is broad and complex and unfortunately, though plugins initially go through an approval system, we don't have complete control over their code and their documentation. I'll share the feedback internally and we'll see how we could simplify the migration process with plugins.

What happens when you delete a reference to a plugin on an instance that had that plugin installed? (You don't say anywhere.)

This is a good point and I don't know at the moment, but I'll look for more information and we'll add it to Strapi docs when we get an answer.

what dependencies need to be installed prior to installing Strapi, installed globally vs locally,

You might want to look at the prerequisites in the Quick Start Guide or in the CLI installation guide.

which version bounds of any dependency is acceptable,

Thanks for the feedback. I'll check with the engineering team and if we can update the docs, we'll do.

Why don't you have an option for a Docker image and a Dockerfile

This is explained in the Docker image creation guide FAQ. In short, it's impossible to create a "one-size-fits-all" Docker image of Strapi due to its headless nature and all the possible combinations (database, for instance) that you can use. The guide explains how to create a Docker image yourself once you've installed Strapi, and also lists available community tools.

what commands to use to try to debug both NPM and Yarn (that was an hour on Stack Overflow).

I'm not sure to understand your question 🤔 Would you like to debug Strapi or to debug NPM/yarn? To debug Strapi you can might find useful commands in the CLI reference. I know some users use strapi console for instance to directly interact with the strapi object.

how to read common errors that might be thrown.

Same, I'm not sure to fully understand. If you have issues while installing Strapi, feel free to report them and to use any support available (see support). Our Discord and forum are a great place to start. If you want to understand how errors are thrown by the Strapi server, we have documentation for this and we also have some examples about how to catch errors sent by the Strapi server in our backend customization examples cookbook.

For the issues related the usage of yarn/npm itself, I encourage you to dive deeper into their corresponding documentation (about what is an engine in a package.json file, for instance). Yarn is a wrapper of npm and as such uses npm under the hood, hence it's not listed as an engine. We understand that using the JavaScript- & React-based headless CMS that is Strapi requires some prior knowledge of some parts of the JavaScript ecosystem. This is something we'll improve in the documentation for the next major version of Strapi, which will be out in a few months, with a public beta in a few weeks. You can have a quick look at this temporary URL: https://documentation-git-v5-breaking-changes-sort-by-id-strapijs.vercel.app/dev-docs/intro. We will also have an AI chatbot that should help answer more questions.

And this was my favorite -- I went to deploy on Strapi Cloud, which I paid for, and ERRORS AGAIN.

I'm sorry to read you're having issues with Strapi Cloud. Please feel free to ask for support.

Shouldn't there just be a button I click and it upgrades? WordPress does that.

You'll be happy to read that Strapi 5 will feature a complete upgrade tool through the CLI. The work-in-progress documentation for it is available on this temporary URL. The initial documentation for Strapi 5 will be live at public beta launch and will be expanded over the course of the Strapi 5 beta period. WordPress and Strapi are very different products and companies, but we're improving Strapi each and everyday thanks to precious feedback sent by users 😊