strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable, and developer-first.
https://strapi.io
Other
63.76k stars 8.12k forks source link

"yarn create strapi-app" fails on Raspbian Buster, unable to install graphql #4052

Closed empaa closed 5 years ago

empaa commented 5 years ago

Describe the bug The yarn create strapi-app command fails on Raspberry Pi 4 running Raspbian Lite. The installer crashes with error message related to mozjpeg module. The app can be built and started after the crash but trying to install graphql then fails due to problems with dependencies and the app want start again without removing the node_modules folder and start over without graphql.

Steps to reproduce the behavior

  1. Run "yarn create strapi-app api".
  2. Enter settings for database or go with quickstart, the result is consistent.
  3. Wait for dependencies to install, the installer will stay a long time at "Installing dependencies: [5/5] Building fresh packages..."
  4. The installer crashes with error code related to mozjpeg module, see below for complete output.
  5. cd into api and run yarn build or develop, the app will build and start. Output below.
  6. Run "yarn strapi install graphql".
  7. The installer will chew for quite som time and finally fail with error message related to mozjpeg. Output below.
  8. "yarn develop/build/start" fails with error message related to module lodash. Output below.
  9. Only way to get up and running again is to delete the node_modules folder and run "yarn build" again. This brings you back to the start without graphql capability.

Expected behavior "yarn create strapi-app api" should install a new project under folder api and install dependencies without errors. "yarn strapi install graphql" should add Graphql-plugin to the project without errors. "yarn develop/build/start" should start the application after these steps have succeeded.

Screenshots If applicable, add screenshots to help explain your problem.

Code snippets Output from "yarn create strapi-app" (4):

$ yarn create strapi-app api
yarn create v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-strapi-app@3.0.0-beta.16.5" with binaries:
      - create-strapi-app
[#####################################################################] 125/125Creating a new Strapi application at /home/pi/api.

? Choose your installation type Custom (manual settings)
? Choose your default database client postgres
? Database name: api_16.5
? Host: 127.0.0.1
? Port: 5432
? Username: pi
? Password: *****
? Enable SSL connection: No

Creating a project with custom database options.
Creating files.
Error while installing dependencies:
warning strapi > boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
warning strapi > boom > hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
warning strapi-admin > postcss-smart-import@0.7.6: This project is not maintained anymore. Please use postcss-import instead.
warning strapi-admin > react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
warning strapi-admin > react-datetime > create-react-class > fbjs > core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
warning strapi-admin > precss > postcss-preset-env > postcss-color-gray > postcss-values-parser > flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
warning strapi-plugin-users-permissions > purest > request > node-uuid@1.4.8: Use uuid module instead
warning strapi-plugin-users-permissions > purest > request > hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning strapi-plugin-users-permissions > purest > request > hawk > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-users-permissions > purest > request > hawk > boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-users-permissions > purest > request > hawk > boom > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-users-permissions > purest > request > hawk > cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-users-permissions > purest > request > hawk > cryptiles > boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-users-permissions > purest > request > hawk > sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
warning strapi-plugin-users-permissions > purest > request > hawk > sntp > hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer@3.12.0: This project is unmaintained
warning strapi-plugin-email > strapi-provider-email-sendmail > sendmail > mailcomposer > buildmail@3.10.0: This project is unmaintained
warning "strapi-admin > buffetjs > react-dates@20.3.0" has unmet peer dependency "react-with-direction@^1.3.0".
warning "strapi-admin > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning "strapi-admin > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning "strapi-plugin-users-permissions > grant-koa@4.6.3" has unmet peer dependency "koa@>=0.x.x".
warning "strapi-hook-bookshelf > bookshelf@0.15.1" has incorrect peer dependency "knex@>=0.13.0 <0.18.0".
warning " > eslint-config-airbnb@18.0.1" has unmet peer dependency "eslint-plugin-jsx-a11y@^6.2.3".
warning " > eslint-config-airbnb@18.0.1" has unmet peer dependency "eslint-plugin-react-hooks@^1.7.0".
error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/home/pi/api/node_modules/mozjpeg/\u0001�\u0017@@�\u000f\f@8\b@\u001eu0006\u0005@@@@@�\u0001�\u0001\b\u0003\u0004\u0002\u0002@\u0002@\u001c\u001c\u0001\u0001\u0005@@\u001c�'".
error Command failed.
Exit code: 1
Command: /home/pi/.yarn/bin/create-strapi-app
Arguments: api
Directory: /home/pi
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

Output of "yarn build" (5):

$ yarn build
yarn run v1.17.3
$ strapi build
Building your admin UI with development configuration ...

✔ Webpack
  Compiled successfully in 2.37m

Done in 145.11s.

Output from "yarn strapi install graphql" (7):

$ yarn strapi install graphql
yarn run v1.17.3
$ strapi install graphql
Command failed: npm install --save strapi-plugin-graphql@3.0.0-beta.16.5
npm WARN deprecated hoek@2.16.3: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated core-js@1.2.7: core-js@<2.6.8 is no longer maintained. Please, upgrade to core-js@3 or at least to actual version of core-js@2.
npm WARN deprecated boom@2.10.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated sntp@1.0.9: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated cryptiles@2.0.5: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated buildmail@3.10.0: This project is unmaintained
npm WARN deprecated flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hawk@3.1.3: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
npm WARN deprecated mailcomposer@3.12.0: This project is unmaintained
npm WARN deprecated boom@7.3.0: This module has moved and is now available at @hapi/boom. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated hoek@6.1.3: This module has moved and is now available at @hapi/hoek. Please update your dependencies as this version is no longer maintained an may contain bugs and security issues.
npm WARN deprecated postcss-smart-import@0.7.6: This project is not maintained anymore. Please use postcss-import instead.
npm WARN rm not removing /home/pi/api/node_modules/.bin/semver as it wasn't installed by /home/pi/api/node_modules/semver
npm WARN rm not removing /home/pi/api/node_modules/.bin/json5 as it wasn't installed by /home/pi/api/node_modules/json5
npm WARN graphql-type-long@0.1.1 requires a peer of graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself.
npm WARN graphql-type-datetime@0.2.4 requires a peer of graphql@^0.13.2 but none is installed. You must install peer dependencies yourself.
npm WARN buffetjs@1.0.5 requires a peer of lodash@^4.17.11 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap@4.3.1 requires a peer of jquery@1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm WARN bookshelf@0.15.1 requires a peer of knex@>=0.13.0 <0.18.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /home/pi/api/node_modules/mozjpeg
npm ERR! code ENOTEMPTY
npm ERR! errno -39
npm ERR! syscall rmdir
npm ERR! ENOTEMPTY: directory not empty, rmdir '/home/pi/api/node_modules/mozjpeg'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-09-19T11_08_01_256Z-debug.log

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

Output "yarn develop" (8):

$ yarn develop
yarn run v1.17.3
$ strapi develop
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/pi/api/node_modules/strapi/bin/strapi.js:4:11)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

System

Additional context I had to manually install autoconf to get this far but I can't figure out how to proceed.

lauriejim commented 5 years ago

Hello @empaa ! I tried on an MacOS with last version of Strapi and it works well - probably related to Raspbian. Can you make sure strapi-plugin-graphql is in your dependencies (package.json) If it is, please try to remove your yarn.lock and re-install your dependencies.

lauriejim commented 5 years ago

I found an issue that could be related to yours but on Gatsby - https://github.com/gatsbyjs/gatsby/issues/12633

empaa commented 5 years ago

@lauriejim thank you! Adding "strapi-plugin-graphql": "3.0.0-beta.16.5" to packages.json, deleting node_modules and running yarn install again results in the same error as the create command but I’m able to do yarn build and start the server afterwards with GraphQL working. It’s an ugly fix but it’s beta and hey, at least it runs now! It all works hassle free on my MacBook too, my conclusion is also that the problem lies somewhere with raspbian/arm. I found that issue on Gatsby earlier but I couldn’t figure it out since the problem is well above my knowledge but I’m happy to have a fix for now. Maybe someone more technical can find a proper solution to this later on :)

derrickmehaffy commented 5 years ago

For now marking this issue as closed as it isn't likely an issue with Strapi but has something to do with rasbian.