Errors when installing strapi (npx create-strapi-app@latest my-project)

System Information
  • Strapi Version: “4.1.8”
  • Operating System: “MacOS Montery Apple M1 v12.3”
  • Database:
  • Node Version: “16.14.2”
  • NPM Version: “8.5.0”
  • Yarn Version: “1.22.18”

Strapi Install Errors

Strapi Version: 4.1.8
Operating System: MacOS Montery Apple M1 v12.3
Node Version: 16.14.2
NPM Version: 8.5.0
NVM Version: 0.39.1
Yarn Version: 1.22.18
node-gyp version: 9.0.0

I’ve been getting multiple install errors when trying to install strapi (I see a lot of node-gyp err & sqllite3).
I have a Mac M1 and it was recently updated and was not having issues before.
I use NVM but have not had problems before.
I tried installing with both npm (npx create-strapi-app@latest my-project) & yarn (yarn create strapi-app my-project --quickstart) and have the same problems.
I’ve noticed that some of the dependencies are installed in completely different folders.

I’ve tried…

  • Changed package.json - ( “better-sqlite3”: “7.4.6” → “better-sqlite3”: “5.0.0” - strapi/strapi/issues/9080 )
  • Uninstall/reinstall node-gyp - (used their mac instructions)
  • Uninstall/reinstall npm packages
  • Checking xcode is installed ( yes → /Applications/Xcode.app/Contents/Developer )

I’ve read pretty much every forum and stack overflow question about this and have found no fix. I’ve specifically looked at previous posts (Cannot create new strapi project - mac - #4 by Daniel_Gustavsson); (strapi not installing with yarn create strapi-app my-project --quickstart · Issue #9120 · strapi/strapi · GitHub) and their solutions and I’ve had no luck.
Please help! Thanks.


Example:

What I did…

  • “npx create-strapi-app@latest my-project” → (got errors & cd into my-project && yarn install)
  • “cd my-project && yarn-install” → (got same errors)

Terminal Output:

➜  forumquestion npx create-strapi-app@latest my-project
? Choose your installation type Quickstart (recommended)
Creating a quickstart project.
Creating a new Strapi application at /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project.
Creating files.
Error while installing dependencies:
warning ../../../../../../package.json: No license field
warning @strapi/strapi > koa-ip > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning @strapi/strapi > 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.
warning @strapi/strapi > @strapi/generate-new > 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.
warning @strapi/strapi > koa-session > 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.
warning @strapi/strapi > @strapi/admin > @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @strapi/strapi > @strapi/admin > @fortawesome/fontawesome-svg-core@1.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > @strapi/plugin-content-type-builder > @strapi/helper-plugin > @fortawesome/fontawesome-svg-core@1.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/admin > @babel/polyfill > core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning @strapi/strapi > @strapi/admin > @fortawesome/fontawesome-svg-core > @fortawesome/fontawesome-common-types@0.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > @strapi/admin > node-polyfill-webpack-plugin > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/plugin-users-permissions > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @strapi/plugin-users-permissions > request > 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.
warning @strapi/plugin-users-permissions > request > har-validator@5.1.5: this library is no longer supported
warning @strapi/plugin-users-permissions > koa2-ratelimit > sequelize@5.22.5: Please update to v6 or higher! A migration guide can be found here: https://sequelize.org/v6/manual/upgrade-to-v6.html
warning @strapi/plugin-users-permissions > koa2-ratelimit > mongoose > @types/mongodb > @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
warning "@strapi/plugin-users-permissions > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "formik@^2.2.6".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "immer@9.0.6".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "qs@6.10.1".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "react-select@^4.0.2".
warning "@strapi/strapi > @strapi/admin > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
warning "@strapi/plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
warning Workspaces can only be enabled in private projects.
error /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3: Command failed.
Exit code: 1
Command: prebuild-install || npm run build-release
Arguments: 
Directory: /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3
Output:
prebuild-install WARN install No prebuilt binaries found (target=16.14.2 runtime=node arch=arm64 libc= platform=darwin)

> better-sqlite3@7.4.6 build-release
> node-gyp rebuild --release

gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.14.2 | darwin | arm64
gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/kendrawing/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   '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kendrawing/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kendrawing/Library/Caches/node-gyp/16.14.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/kendrawing/Library/Caches/node-gyp/16.14.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/kendrawing/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/kendrawing/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3',
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' ]
  TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
/bin/sh: Practice/Strapi: No such file or directory
/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
                                            ^

CwdError: ENOENT: Cannot cd into '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
    at /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/tar/lib/mkdir.js:43:12
    at FSReqCallback.oncomplete (node:fs:198:21) {
  path: '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3',
  code: 'ENOENT'
}
make: *** [b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kendrawing/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.4.0
gyp ERR! command "/Users/kendrawing/.nvm/versions/node/v16.14.2/bin/node" "/Users/kendrawing/node_modules/.bin/node-gyp" "rebuild" "--release"
gyp ERR! cwd /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3
gyp ERR! node -v v16.14.2
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok

 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/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project && yarn install

➜  forumquestion cd my-project
➜  my-project yarn install
yarn install v1.22.18
warning ../../../../../../package.json: No license field
info No lockfile found.
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
warning @strapi/strapi > koa-ip > debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
warning @strapi/strapi > 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.
warning @strapi/strapi > koa-session > 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.
warning @strapi/strapi > @strapi/admin > @babel/polyfill@7.12.1: 🚨 This package has been deprecated in favor of separate inclusion of a polyfill and regenerator-runtime (when needed). See the @babel/polyfill docs (https://babeljs.io/docs/en/babel-polyfill) for more information.
warning @strapi/strapi > @strapi/admin > @fortawesome/fontawesome-svg-core@1.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > @strapi/plugin-content-type-builder > @strapi/helper-plugin > @fortawesome/fontawesome-svg-core@1.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > @strapi/generate-new > 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.
warning @strapi/strapi > koa-body > formidable@1.2.6: Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau
warning @strapi/strapi > @strapi/admin > @babel/polyfill > core-js@2.6.12: core-js@<3.4 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
warning @strapi/strapi > @strapi/admin > @fortawesome/fontawesome-svg-core > @fortawesome/fontawesome-common-types@0.3.0: Please upgrade to 6.1.0. https://fontawesome.com/docs/changelog/
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning @strapi/strapi > @strapi/admin > node-polyfill-webpack-plugin > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning @strapi/strapi > @strapi/plugin-email > @strapi/provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning @strapi/strapi > @strapi/generators > plop > liftoff > findup-sync > micromatch > snapdragon > source-map-resolve > source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
warning @strapi/plugin-users-permissions > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
warning @strapi/plugin-users-permissions > request > 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.
warning @strapi/plugin-users-permissions > request > har-validator@5.1.5: this library is no longer supported
warning @strapi/plugin-users-permissions > koa2-ratelimit > sequelize@5.22.5: Please update to v6 or higher! A migration guide can be found here: https://sequelize.org/v6/manual/upgrade-to-v6.html
warning @strapi/plugin-users-permissions > koa2-ratelimit > mongoose > @types/mongodb > @types/bson@4.2.0: This is a stub types definition. bson provides its own type definitions, so you do not need this installed.
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning "@strapi/plugin-users-permissions > react-redux@7.2.3" has unmet peer dependency "redux@^2.0.0 || ^3.0.0 || ^4.0.0-0".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "formik@^2.2.6".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "immer@9.0.6".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "qs@6.10.1".
warning "@strapi/plugin-users-permissions > @strapi/helper-plugin@4.1.8" has unmet peer dependency "react-select@^4.0.2".
warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react@^15.3.0 || ^16.0.0-alpha".
warning "@strapi/strapi > @strapi/admin > react-virtualized@9.22.3" has incorrect peer dependency "react-dom@^15.3.0 || ^16.0.0-alpha".
warning "@strapi/strapi > @strapi/admin > styled-components@5.3.3" has unmet peer dependency "react-is@>= 16.8.0".
warning "@strapi/plugin-users-permissions > grant-koa@5.4.8" has unmet peer dependency "koa@>=2.0.0".
warning Workspaces can only be enabled in private projects.
[5/5] 🔨  Building fresh packages...
[10/12] ⠁ sharp
[-/12] ⠁ waiting...
[-/12] ⠁ waiting...
[11/12] ⠁ better-sqlite3
error /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3: Command failed.
Exit code: 1
Command: prebuild-install || npm run build-release
Arguments: 
Directory: /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3
Output:
prebuild-install WARN install No prebuilt binaries found (target=16.14.2 runtime=node arch=arm64 libc= platform=darwin)

> better-sqlite3@7.4.6 build-release
> node-gyp rebuild --release

gyp info it worked if it ends with ok
gyp info using node-gyp@9.0.0
gyp info using node@16.14.2 | darwin | arm64
gyp info find Python using Python version 3.8.9 found at "/Applications/Xcode.app/Contents/Developer/usr/bin/python3"
gyp info spawn /Applications/Xcode.app/Contents/Developer/usr/bin/python3
gyp info spawn args [
gyp info spawn args   '/Users/kendrawing/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   '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kendrawing/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/kendrawing/Library/Caches/node-gyp/16.14.2/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/kendrawing/Library/Caches/node-gyp/16.14.2',
gyp info spawn args   '-Dnode_gyp_dir=/Users/kendrawing/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/kendrawing/Library/Caches/node-gyp/16.14.2/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3',
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' ]
  TOUCH b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
  ACTION deps_sqlite3_gyp_locate_sqlite3_target_extract_sqlite3 b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
/bin/sh: Practice/Strapi: No such file or directory
/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/deps/extract.js:8
process.on('unhandledRejection', (err) => { throw err; });
                                            ^

CwdError: ENOENT: Cannot cd into '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3'
    at /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/tar/lib/mkdir.js:43:12
    at FSReqCallback.oncomplete (node:fs:198:21) {
  path: '/Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3/build/Release/obj/gen/sqlite3',
  code: 'ENOENT'
}
make: *** [b857c92884e9598d609f6be182a2595df7a8e00f.intermediate] Error 1
rm b857c92884e9598d609f6be182a2595df7a8e00f.intermediate
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/kendrawing/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:526:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
gyp ERR! System Darwin 21.4.0
gyp ERR! command "/Users/kendrawing/.nvm/versions/node/v16.14.2/bin/node" "/Users/kendrawing/node_modules/.bin/node-gyp" "rebuild" "--release"
gyp ERR! cwd /Users/kendrawing/Documents/Coding/4 Practice/Strapi Stuff/forumquestion/my-project/node_modules/better-sqlite3

// package.json

{
  "name": "my-project",
  "private": true,
  "version": "0.1.0",
  "description": "A Strapi application",
  "scripts": {
    "develop": "strapi develop",
    "start": "strapi start",
    "build": "strapi build",
    "strapi": "strapi"
  },
  "devDependencies": {},
  "dependencies": {
    "@strapi/strapi": "4.1.8",
    "@strapi/plugin-users-permissions": "4.1.8",
    "@strapi/plugin-i18n": "4.1.8",
    "better-sqlite3": "7.4.6"
  },
  "author": {
    "name": "A Strapi developer"
  },
  "strapi": {
    "uuid": "7d43367c-29d9-411a-abc7-7cd4a7421c1d"
  },
  "engines": {
    "node": ">=12.x.x <=16.x.x",
    "npm": ">=6.0.0"
  },
  "license": "MIT"
}
```

Most likely you are like me and your internet is not very strong. You can increase the timeout for node eg on linux run this command
cat timeout 600000 > ~/.npmrc

Then try to setup strapi again.

I’m on a mac but I tried running this command in my terminal-

➜  ~ cat timeout 600000 > ~/.npmrc
cat: timeout: No such file or directory
cat: 600000: No such file or directory

?

➜  ~ cd ~/.npmrc
cd: not a directory: /Users/kendrawing/.npmrc

The idea is to create a text file named .npmrc in your home directory with the content timeout 6000000
However I found a better way. Read this article

Also, some guys have reported issues with nodejs on mac M1. If you are using M1 try installing nodejs 14 and see if that helps

hello i just also came across this problem while creating strapi app using this method(npx create-strapi-app@latest my-project --quickstart) then after hours of search i have came across to this solution that is: after using the above method, while it complains saying ‘error while installing dependencies…’ fto solve and get running with strapi install yarn(npm install yarn -g) then after finish type ‘yarn develop’ after this it should show up a new screen of ur browser to login to your strapi dashboard, congra!!, share this if it helps you, lets the coding community gets better and smarter.

Hi, I had the same problem and I searched for its solution more than two days and I finally found. My problem was with node version on my machine because I already have installed the latest version of node (18) than I noticed that this version is not supported by strapi and I have to install node (16 or 14.) Then when I installed node (16) and setup strapi again everything surprisingly worked fine. I hope you solve your problem too

3 Likes

I tried everything and dowgrading to node v14 fixed it for me. I am running M1 mac with Ventura os

1 Like

it also works for me! running arm mac with ventura 13.0.1

This solutions worked for me, lm on windows 10

That’s weird, because the Strapi prerequisites on the quickstart getting started page says that Node v18.x is recommended for Strapi v4.3.9 and above. The Strapi version in use currently is 4.5.5. It also says use npm v6 only.

See the documentation here:

I am using Node v18.13.0 and npm v6.14.18 and still I get errors:

npx: installed 105 in 74.134s
Creating a quickstart project.
Creating a new Strapi application at C:\Users\nazaq\OneDrive\Documents\Business\Strapi\softwareagency\backend.
Creating files.
Error while installing dependencies:
npm WARN deprecated request@2.88.2: request has been deprecated, see Issues · request/request · GitHub 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 har-validator@5.1.5: this library is no longer supported
npm WARN deprecated mini-create-react-context@0.4.1: Package no longer supported. Contact Support at npm | Support for more info.
npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
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 resolve-url@0.2.1: GitHub - lydell/resolve-url: [DEPRECATED] Like Node.js’ `path.resolve`/`url.resolve` for the browser.
npm WARN deprecated source-map-url@0.4.1: See GitHub - lydell/source-map-url: [DEPRECATED] Tools for working with sourceMappingURL comments.
npm WARN deprecated urix@0.1.0: Please see GitHub - lydell/urix: [DEPRECATED] Makes Windows-style paths more unix and URI friendly.
prebuild-install warn install No prebuilt binaries found (target=18.13.0 runtime=node arch=x64 libc= platform=win32)
npm WARN config cache-max This option has been deprecated in favor of --prefer-online
npm WARN config cache-min This option has been deprecated in favor of --prefer-offline.
npm WARN config production Use --omit=dev instead.
npm WARN config shrinkwrap Use the --package-lock setting instead.
npm WARN config sso-poll-frequency The --auth-type method of SSO/SAML/OAuth will be removed in a future
npm WARN config version of npm in favor of web-based login.
npm WARN config sso-type The --auth-type method of SSO/SAML/OAuth will be removed in a future
npm WARN config version of npm in favor of web-based login.
npm WARN config tmp This setting is no longer used. npm stores temporary files in a special
npm WARN config location in the cache, and they are managed by
npm WARN config cacache.
(node:10428) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use node --trace-deprecation ... to show where the warning was created)
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\MSBuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\nazaq\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194: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 Windows_NT 10.0.19044
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Users\nazaq\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild” “–release”
gyp ERR! cwd C:\Users\nazaq\OneDrive\Documents\Business\Strapi\softwareagency\backend\node_modules\better-sqlite3
gyp ERR! node -v v18.13.0
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.4.6 build-release: node-gyp rebuild --release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@7.4.6 build-release script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nazaq\AppData\Roaming\npm-cache_logs\2023-01-08T19_37_29_608Z-debug.log
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-freebsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.15.18: wanted {“os”:“freebsd”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-darwin-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-64@0.15.18: wanted {“os”:“darwin”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/linux-loong64@0.15.18 (node_modules\esbuild\node_modules@esbuild\linux-loong64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/linux-loong64@0.15.18: wanted {“os”:“linux”,“arch”:“loong64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.15.18 (node_modules\esbuild\node_modules\esbuild-freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.15.18: wanted {“os”:“freebsd”,“arch”:“arm64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.15.18 (node_modules\esbuild\node_modules\esbuild-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.15.18: wanted {“os”:“darwin”,“arch”:“arm64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.15.18: wanted {“os”:“linux”,“arch”:“ia32”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: @esbuild/android-arm@0.15.18 (node_modules\esbuild\node_modules@esbuild\android-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for @esbuild/android-arm@0.15.18: wanted {“os”:“android”,“arch”:“arm”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-64@0.15.18: wanted {“os”:“linux”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.15.18: wanted {“os”:“linux”,“arch”:“arm64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-ppc64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.15.18: wanted {“os”:“linux”,“arch”:“ppc64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-riscv64@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-riscv64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-riscv64@0.15.18: wanted {“os”:“linux”,“arch”:“riscv64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-android-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-64@0.15.18: wanted {“os”:“android”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.15.18 (node_modules\esbuild\node_modules\esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.15.18: wanted {“os”:“android”,“arch”:“arm64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.15.18 (node_modules\esbuild\node_modules\esbuild-windows-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.15.18: wanted {“os”:“win32”,“arch”:“arm64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.15.18: wanted {“os”:“linux”,“arch”:“arm”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-mips64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.15.18: wanted {“os”:“linux”,“arch”:“mips64el”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-netbsd-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-netbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-netbsd-64@0.15.18: wanted {“os”:“netbsd”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-openbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.15.18: wanted {“os”:“openbsd”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-s390x@0.15.18 (node_modules\esbuild\node_modules\esbuild-linux-s390x):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-s390x@0.15.18: wanted {“os”:“linux”,“arch”:“s390x”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.15.18 (node_modules\esbuild\node_modules\esbuild-sunos-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.15.18: wanted {“os”:“sunos”,“arch”:“x64”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-32@0.15.18 (node_modules\esbuild\node_modules\esbuild-windows-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-32@0.15.18: wanted {“os”:“win32”,“arch”:“ia32”} (current: {“os”:“win32”,“arch”:“x64”})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! better-sqlite3@7.4.6 install: prebuild-install || npm run build-release
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the better-sqlite3@7.4.6 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\nazaq\AppData\Roaming\npm-cache_logs\2023-01-08T19_37_35_134Z-debug.log

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:\Users\nazaq\OneDrive\Documents\Business\Strapi\project\backend && npm install

try “node”: “16.18.0”, and “npm”: “8.19.2”. It’s worked with me.

2 Likes

thanks a lot, after trying each and every solutions ,finally your solution worked for me

thank u! I used 16.18.0 node and yarn package manager

Thanks for the solution. I downloaded an older node version 16.3.0 with NVM and simultaneously created the older strapi app version 4.3.8 and switched to the older node version for this use case and now it is working fine.

Same problem …
How to fix it …?
Anyone please help me
I amm Windows user