Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails while trying to install strapi@beta - v3.0.0-beta.3 #3421

Closed
palaima opened this issue Jun 11, 2019 · 19 comments
Closed

Docker build fails while trying to install strapi@beta - v3.0.0-beta.3 #3421

palaima opened this issue Jun 11, 2019 · 19 comments

Comments

@palaima
Copy link

palaima commented Jun 11, 2019

Hello,

Having an issue while trying to build docker container with beta.
See details below:

Docker build fails while trying to install strapi@beta version
Docker build fails on running npm install -g strapi@beta if beta is replaced with alpha version then installation/build succeeds.

Dockerfile

FROM node:10.16.0-alpine

ENV APP_ROOT /usr/src/api

WORKDIR $APP_ROOT/

RUN echo "unsafe-perm = true" >> ~/.npmrc

#build succeeds
#RUN npm install -g strapi@alpha

#build fails
RUN npm install -g strapi@beta

ARG APP_NAME
ENV APP_NAME ${APP_NAME:-app}

COPY ${APP_NAME} ./${APP_NAME}/

COPY strapi.sh ./
RUN chmod +x ./strapi.sh

EXPOSE $PORT

COPY healthcheck.js ./
HEALTHCHECK --interval=15s --timeout=5s --start-period=30s \
      CMD node /usr/src/api/healthcheck.js

CMD ["./strapi.sh"]

Steps to reproduce the behavior

  1. Run docker build -t app .
  2. Build fails with following error:

**docker build -t app . **

Sending build context to Docker daemon  324.4MB
Step 1/17 : FROM node:10.16.0-alpine
 ---> 9dfa73010b19
Step 2/17 : ENV APP_ROOT /usr/src/api
 ---> Using cache
 ---> cd3c9b49df01
Step 3/17 : WORKDIR $APP_ROOT/
 ---> Using cache
 ---> 470027a1bb7b
Step 4/17 : RUN echo "unsafe-perm = true" >> ~/.npmrc
 ---> Using cache
 ---> 7c73a8a7e6bf
Step 5/17 : RUN npm install -g strapi@beta
 ---> Running in 4edaaab4302a
npm WARN deprecated boom@5.2.0: 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 hoek@4.2.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 flatten@1.0.2: I wrote this module a very long time ago; you should use something else.
npm WARN deprecated joi@10.2.2: 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 items@2.1.2: This module has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version of hapi 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 topo@2.0.2: 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 @babel/polyfill@7.4.4: 🚨 As of Babel 7.4.0, this
npm WARN deprecated package has been deprecated in favor of directly
npm WARN deprecated including core-js/stable (to polyfill ECMAScript
npm WARN deprecated features) and regenerator-runtime/runtime
npm WARN deprecated (needed to use transpiled generator functions):
npm WARN deprecated 
npm WARN deprecated   > import "core-js/stable";
npm WARN deprecated   > import "regenerator-runtime/runtime";
npm WARN deprecated postcss-smart-import@0.7.6: This project is not maintained anymore. Please use postcss-import instead.
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.
/usr/local/bin/strapi -> /usr/local/lib/node_modules/strapi/bin/strapi.js

> node-sass@4.12.0 install /usr/local/lib/node_modules/strapi/node_modules/node-sass
> node scripts/install.js

Downloading binary from https://github.com/sass/node-sass/releases/download/v4.12.0/linux_musl-x64-64_binding.node
Download complete
Binary saved to /usr/local/lib/node_modules/strapi/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node
Caching binary to /root/.npm/node-sass/4.12.0/linux_musl-x64-64_binding.node

> core-js@2.6.9 postinstall /usr/local/lib/node_modules/strapi/node_modules/core-js
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> core-js-pure@3.1.3 postinstall /usr/local/lib/node_modules/strapi/node_modules/core-js-pure
> node scripts/postinstall || echo "ignore"

Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!

The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: 
> https://opencollective.com/core-js 
> https://www.patreon.com/zloirock 

Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)


> styled-components@4.3.1 postinstall /usr/local/lib/node_modules/strapi/node_modules/styled-components
> node ./scripts/postinstall.js || exit 0

Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components

> node-sass@4.12.0 postinstall /usr/local/lib/node_modules/strapi/node_modules/node-sass
> node scripts/build.js

Binary found at /usr/local/lib/node_modules/strapi/node_modules/node-sass/vendor/linux_musl-x64-64/binding.node
Testing binary
Binary is fine

> cwebp-bin@5.1.0 postinstall /usr/local/lib/node_modules/strapi/node_modules/cwebp-bin
> node lib/install.js

  ⚠ spawn /usr/local/lib/node_modules/strapi/node_modules/cwebp-bin/vendor/cwebp ENOENT
  ⚠ cwebp pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c ./configure --disable-shared --prefix="/usr/local/lib/node_modules/strapi/node_modules/cwebp-bin/vendor" --bindir="/usr/local/lib/node_modules/strapi/node_modules/cwebp-bin/vendor"
configure: error: in `/tmp/33e3f430-25c8-4517-8896-5fadcd5273bf':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether make supports nested variables... no
checking for style of include used by make... none
checking for gcc... no
checking for cc... no
checking for cl.exe... no

    at Promise.all.then.arr (/usr/local/lib/node_modules/strapi/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)

> gifsicle@4.0.1 postinstall /usr/local/lib/node_modules/strapi/node_modules/gifsicle
> node lib/install.js

  ⚠ spawn /usr/local/lib/node_modules/strapi/node_modules/gifsicle/vendor/gifsicle ENOENT
  ⚠ gifsicle pre-build test failed
  ℹ compiling from source
  ✖ Error: Command failed: /bin/sh -c autoreconf -ivf
/bin/sh: autoreconf: not found


    at Promise.all.then.arr (/usr/local/lib/node_modules/strapi/node_modules/bin-build/node_modules/execa/index.js:231:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
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 optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules/strapi/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! gifsicle@4.0.1 postinstall: `node lib/install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the gifsicle@4.0.1 postinstall 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!     /root/.npm/_logs/2019-06-11T10_47_09_517Z-debug.log
The command '/bin/sh -c npm install -g strapi@beta' returned a non-zero code: 1

Expected behavior
Builds successfully (same as using strapi@alpha)

System

  • Node.js version: 10.16.0
  • Strapi version: 3.0.0-beta.3

Any thoughts? Maybe I'm missing something?

@paescuj
Copy link

paescuj commented Jun 11, 2019

You need to install the required build dependencies before running 'npm install':

apk add --no-cache build-base gcc autoconf automake libtool zlib-dev libpng-dev nasm

@alexandrebodin
Copy link
Member

Hi closing this issue as @paescuj gave a correct way to fix this.

@palaima
Copy link
Author

palaima commented Jun 13, 2019

Thanks. it does solve the issue.

Is it the right way to address this issue or it would be solved later with new beta versions?

@botzill
Copy link

botzill commented Jun 13, 2019

How about updating the official dockerfile repo https://github.com/strapi/strapi-docker ?

@alexandrebodin
Copy link
Member

Sure we want to update it there are already some PRs we need to make sure they don't break things which is time consuming but it will be updated as soon as we possibly can

@tomhaydn
Copy link

tomhaydn commented Aug 1, 2019

Sure we want to update it there are already some PRs we need to make sure they don't break things which is time consuming but it will be updated as soon as we possibly can

Any update on this?

@derrickmehaffy
Copy link
Member

There is no update @tomeady

@walkerandco
Copy link

This is a blocker for building the Dockerfile using strapi/strapi. There are two general issues with a vanilla Dockerfile build which make orchestration difficult. The first is that bootstrapping is unpredictable, within Kubernetes it will crash for a while before starting successfully because the bootstrap function takes to long. In addition, there is no decent way of injecting database secrets into the application because it requires the use of a static database.json file. You can use sed in a pipeline during deployment, but this is cumbersome and not a very pragmatic approach. It would be better if this image could be maintained because it solves these problems - the changes are quite small and can be tested straightforwardly. What is holding this up, is there something we can help with?

@derrickmehaffy
Copy link
Member

@walkerandco you can use env variables to inject secrets just about anywhere in the configs, for example the database.json here is an example of mine

@walkerandco
Copy link

@derrickmehaffy Thanks for this, this is very helpful. Perhaps me being naive, I didn't realise it would pull the env variable from a JSON file if process.env was stuck in there (JSON files don't usually substitute), this is really handy.

@heavenkiller2018
Copy link

@alexandrebodin @paescuj

the problem still exists with your way,

john@dev:/mnt/d/vscode/example2/strapi$ sudo apt install build-base gcc autoconf automake libtool zlib-dev libpng-dev nasm
error as:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package build-base
E: Unable to locate package zlib-dev

in wsl ubuntu linux environment, could you give me some advice that the install command should be?

@derrickmehaffy
Copy link
Member

@heavenkiller2018 you only need two apt packages to build sudo apt install build-essential libpng-dev -y

@heavenkiller2018
Copy link

heavenkiller2018 commented Jan 6, 2020

@derrickmehaffy thanks for your advice. but, it shows another error that seems about "xxhash" and " node-gyp" , what's the problem?

besides, how to fix it in win10 os platform but not linux ?

You need to install the required build dependencies before running 'npm install':
apk add --no-cache build-base gcc autoconf automake libtool zlib-dev libpng-dev nasm

error info:

john@dev-pc-64g-8cpu:/mnt/d/vscode/example2/strapi$ sudo yarn install
[sudo] password for john:
yarn install v1.17.3
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > enzyme-adapter-react-16@1.14.0" has unmet peer dependency "react@^16.0.0-0".
warning " > enzyme-adapter-react-16@1.14.0" has unmet peer dependency "react-dom@^16.0.0-0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils@1.12.0" has unmet peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0".
warning "enzyme-adapter-react-16 > react-test-renderer@16.8.6" has unmet peer dependency "react@^16.0.0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils > airbnb-prop-types@2.13.2" has unmet peer dependency "react@^0.14 || ^15.0.0 || ^16.0.0-alpha".
warning " > eslint-plugin-redux-saga@1.0.0" has unmet peer dependency "redux-saga@>= 0.11.1 < 1 || >= 1.0.0".
warning "workspace-aggregator-b38f8fb3-c7d9-4365-8969-2eaed3fc0e76 > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning "workspace-aggregator-b38f8fb3-c7d9-4365-8969-2eaed3fc0e76 > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning "workspace-aggregator-b38f8fb3-c7d9-4365-8969-2eaed3fc0e76 > strapi-hook-bookshelf > bookshelf@0.15.1" has unmet peer dependency "knex@>=0.13.0 <0.18.0".
warning "workspace-aggregator-b38f8fb3-c7d9-4365-8969-2eaed3fc0e76 > strapi-plugin-graphql > graphql-type-datetime@0.2.4" has incorrect peer dependency "graphql@^0.13.2".
warning "workspace-aggregator-b38f8fb3-c7d9-4365-8969-2eaed3fc0e76 > strapi-plugin-graphql > graphql-type-long@0.1.1" has incorrect peer dependency "graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0".
[5/5] Building fresh packages...
[7/20] ⠂ cypress
[9/20] ⠂ cwebp-bin
[13/20] ⠄ metrohash
[14/20] ⠄ xxhash
warning Error running install script for optional dependency: "/mnt/d/vscode/example2/strapi/node_modules/xxhash: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /mnt/d/vscode/example2/strapi/node_modules/xxhash
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@3.8.0
gyp info using node@12.6.0 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [
gyp info spawn args '/mnt/d/vscode/example2/strapi/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 '/mnt/d/vscode/example2/strapi/node_modules/xxhash/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/mnt/d/vscode/example2/strapi/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/john/.node-gyp/12.6.0/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/john/.node-gyp/12.6.0',
gyp info spawn args '-Dnode_gyp_dir=/mnt/d/vscode/example2/strapi/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/home/john/.node-gyp/12.6.0/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/mnt/d/vscode/example2/strapi/node_modules/xxhash',
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 '/mnt/d/vscode/example2/strapi/node_modules/xxhash/build'
CXX(target) Release/obj.target/hash/src/hash.o
In file included from ../src/hash.cc:3:0:
../src/hash_32.hpp:147:28: error: ‘Handle’ has not been declared
static void Initialize(Handle target) {
^~~~~~
../src/hash_32.hpp:147:34: error: expected ‘,’ or ‘...’ before ‘<’ token
static void Initialize(Handle target) {
^
../src/hash_32.hpp: In static member function ‘static uint32_t Hash32::convert_seed(v8::Localv8::Value)’:
../src/hash_32.hpp:57:38: error: no matching function for call to ‘v8::Value::Uint32Value()’
return seed_val->Uint32Value();
^
In file included from /home/john/.node-gyp/12.6.0/include/node/node.h:63:0,
from ../src/hash.cc:1:
/home/john/.node-gyp/12.6.0/include/node/v8.h:2567:41: note: candidate: v8::Maybe v8::Value::Uint32Value(v8::Localv8::Context) const
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^~~~~~~~~~~
/home/john/.node-gyp/12.6.0/include/node/v8.h:2567:41: note: candidate expects 1 argument, 0 provided
In file included from ../src/hash.cc:3:0:
../src/hash_32.hpp: In static member function ‘static void Hash32::Initialize(int)’:
../src/hash_32.hpp:157:7: error: ‘target’ was not declared in this scope
target->Set(name, tpl->GetFunction());
^~~~~~
../src/hash_32.hpp:157:7: note: suggested alternative: ‘tzset’
target->Set(name, tpl->GetFunction());
^~~~~~
tzset
../src/hash_32.hpp:157:42: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
target->Set(name, tpl->GetFunction());
^
In file included from /home/john/.node-gyp/12.6.0/include/node/node.h:63:0,
from ../src/hash.cc:1:
/home/john/.node-gyp/12.6.0/include/node/v8.h:5948:46: note: candidate: v8::MaybeLocalv8::Function v8::FunctionTemplate::GetFunction(v8::Localv8::Context)
V8_WARN_UNUSED_RESULT MaybeLocal GetFunction(
^~~~~~~~~~~
/home/john/.node-gyp/12.6.0/include/node/v8.h:5948:46: note: candidate expects 1 argument, 0 provided
In file included from ../src/hash.cc:4:0:
../src/hash_64.hpp: At global scope:
../src/hash_64.hpp:147:28: error: ‘Handle’ has not been declared
static void Initialize(Handle target) {
^~~~~~
../src/hash_64.hpp:147:34: error: expected ‘,’ or ‘...’ before ‘<’ token
static void Initialize(Handle target) {
^
../src/hash_64.hpp: In static member function ‘static uint64_t Hash64::convert_seed(v8::Localv8::Value)’:
../src/hash_64.hpp:57:38: error: no matching function for call to ‘v8::Value::Uint32Value()’
return seed_val->Uint32Value();
^
In file included from /home/john/.node-gyp/12.6.0/include/node/node.h:63:0,
from ../src/hash.cc:1:
/home/john/.node-gyp/12.6.0/include/node/v8.h:2567:41: note: candidate: v8::Maybe v8::Value::Uint32Value(v8::Localv8::Context) const
V8_WARN_UNUSED_RESULT Maybe<uint32_t> Uint32Value(
^~~~~~~~~~~
/home/john/.node-gyp/12.6.0/include/node/v8.h:2567:41: note: candidate expects 1 argument, 0 provided
In file included from ../src/hash.cc:4:0:
../src/hash_64.hpp: In static member function ‘static void Hash64::Initialize(int)’:
../src/hash_64.hpp:158:7: error: ‘target’ was not declared in this scope
target->Set(name, tpl->GetFunction());
^~~~~~
../src/hash_64.hpp:158:7: note: suggested alternative: ‘tzset’
target->Set(name, tpl->GetFunction());
^~~~~~
tzset
../src/hash_64.hpp:158:42: error: no matching function for call to ‘v8::FunctionTemplate::GetFunction()’
target->Set(name, tpl->GetFunction());
^
In file included from /home/john/.node-gyp/12.6.0/include/node/node.h:63:0,
from ../src/hash.cc:1:
/home/john/.node-gyp/12.6.0/include/node/v8.h:5948:46: note: candidate: v8::MaybeLocalv8::Function v8::FunctionTemplate::GetFunction(v8::Localv8::Context)
V8_WARN_UNUSED_RESULT MaybeLocal GetFunction(
^~~~~~~~~~~
/home/john/.node-gyp/12.6.0/include/node/v8.h:5948:46: note: candidate expects 1 argument, 0 provided
../src/hash.cc: At global scope:
../src/hash.cc:7:17: error: variable or field ‘Init’ declared void
void Init(v8::Handlev8::Object target) {
^~~~~~
../src/hash.cc:7:17: error: ‘Handle’ is not a member of ‘v8’
../src/hash.cc:7:34: error: expected primary-expression before ‘>’ token
void Init(v8::Handlev8::Object target) {
^
../src/hash.cc:7:36: error: ‘target’ was not declared in this scope
void Init(v8::Handlev8::Object target) {
^~~~~~
../src/hash.cc:7:36: note: suggested alternative: ‘tzset’
void Init(v8::Handlev8::Object target) {
^~~~~~
tzset
In file included from ../src/hash.cc:1:0:
../src/hash.cc:12:21: error: ‘Init’ was not declared in this scope
NODE_MODULE(hash, Init);
^
/home/john/.node-gyp/12.6.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc), \\n ^~~~~~~
../src/hash.cc:12:3: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(hash, Init);
^~~~~~~~~~~
../src/hash.cc:12:21: note: suggested alternative:
NODE_MODULE(hash, Init);
^
/home/john/.node-gyp/12.6.0/include/node/node.h:556:36: note: in definition of macro ‘NODE_MODULE_X’
(node::addon_register_func) (regfunc), \\n ^~~~~~~
../src/hash.cc:12:3: note: in expansion of macro ‘NODE_MODULE’
NODE_MODULE(hash, Init);
^~~~~~~~~~~
/home/john/.node-gyp/12.6.0/include/node/node.h:217:18: note: ‘node::Init’
NODE_EXTERN void Init(int* argc,
^~~~
hash.target.mk:114: recipe for target 'Release/obj.target/hash/src/hash.o' failed
make: Leaving directory '/mnt/d/vscode/example2/strapi/node_modules/xxhash/build'
make: *** [Release/obj.target/hash/src/hash.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/mnt/d/vscode/example2/strapi/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack at ChildProcess.emit (events.js:203:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.0-17763-Microsoft
gyp ERR! command "/usr/local/bin/node" "/mnt/d/vscode/example2/strapi/node_modules/.bin/node-gyp" "rebuild"
gyp ERR! cwd /mnt/d/vscode/example2/strapi/node_modules/xxhash
[7/20] ⠠ cypress
[-/20] ⠠ waiting...
[-/20] ⠠ waiting...
[-/20] ⠐ waiting...
^C/20] ⠐ waiting...

@derrickmehaffy
Copy link
Member

Ah alright it's missing node-gyp which happens on some systems and not others, this may be from WSL itself because Microsoft really messed up the base ubuntu install for WSL1/2.

sudo apt install build-essential libpng-dev node-gyp -y You can remove all the other packages you are trying to install (most are installed with build-essential anyway, no point in specifying them twice)

@derrickmehaffy
Copy link
Member

(For reference node-gyp is a python based build package)

@heavenkiller2018
Copy link

@derrickmehaffy
i removed node-gyp and then reinstalled it again.

the left error is about 'xxhash', but I can't search anything about it. I don't known what's wrong with it!

john@dev-pc-64g-8cpu:/mnt/d/vscode/example2/strapi$ sudo yarn install
[sudo] password for john:
yarn install v1.17.3
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > enzyme-adapter-react-16@1.14.0" has unmet peer dependency "react@^16.0.0-0".
warning " > enzyme-adapter-react-16@1.14.0" has unmet peer dependency "react-dom@^16.0.0-0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils@1.12.0" has unmet peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0".
warning "enzyme-adapter-react-16 > react-test-renderer@16.8.6" has unmet peer dependency "react@^16.0.0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils > airbnb-prop-types@2.13.2" has unmet peer dependency "react@^0.14 || ^15.0.0 || ^16.0.0-alpha".
warning " > eslint-plugin-redux-saga@1.0.0" has unmet peer dependency "redux-saga@>= 0.11.1 < 1 || >= 1.0.0".
warning "workspace-aggregator-2680fdb1-e444-47ac-bd76-8295af6b1a2b > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 - 3".
warning "workspace-aggregator-2680fdb1-e444-47ac-bd76-8295af6b1a2b > strapi-helper-plugin > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning "workspace-aggregator-2680fdb1-e444-47ac-bd76-8295af6b1a2b > strapi-hook-bookshelf > bookshelf@0.15.1" has unmet peer dependency "knex@>=0.13.0 <0.18.0".
warning "workspace-aggregator-2680fdb1-e444-47ac-bd76-8295af6b1a2b > strapi-plugin-graphql > graphql-type-datetime@0.2.4" has incorrect peer dependency "graphql@^0.13.2".
warning "workspace-aggregator-2680fdb1-e444-47ac-bd76-8295af6b1a2b > strapi-plugin-graphql > graphql-type-long@0.1.1" has incorrect peer dependency "graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0".
error An unexpected error occurred: "EINVAL: invalid argument, lstat '/mnt/d/vscode/example2/strapi/node_modules/xxhash/lib/xxhash.js'".
info If you think this is a bug, please open a bug report with the information provided in "/mnt/d/vscode/example2/strapi/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
john@dev-pc-64g-8cpu:/mnt/d/vscode/example2/strapi$

yarn-error.log:
Arguments:
/usr/local/bin/node /usr/local/bin/yarn install

PATH:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

Yarn version:
1.17.3

Node version:
12.6.0

Platform:
linux x64

Trace:
Error: EINVAL: invalid argument, lstat '/mnt/d/vscode/example2/strapi/node_modules/xxhash/lib/xxhash.js'

npm manifest:
{
"private": true,
"dependencies": {},
"devDependencies": {
"babel-eslint": "^10.0.1",
"cross-env": "^5.2.0",
...

@heavenkiller2018
Copy link

heavenkiller2018 commented Jan 7, 2020

@derrickmehaffy , I handled it finally. the error above should due to the wsl linux. the problem is resolved by add some code to ~/.bashrc

append the following code to ~/.bashrc::

# Workaround for issue: https://github.com/Microsoft/WSL/issues/2448
if ! mount | grep -q "C: on /mnt/c type drvfs (rw,noatime,fallback=1)"; then
        echo "== Remount of C: drive required =="
        pushd ~ > /dev/null
        sudo umount /mnt/c
        sudo mount -t drvfs -o noatime,fallback=1 C: /mnt/c
        popd > /dev/null
fi

now, I run "yarn install " normally , thanks for your help! @derrickmehaffy

ohn@dev-pc-64g-8cpu:/mnt/c/code/strapi$ sudo yarn install
yarn install v1.17.3
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.1.1: The platform "linux" is incompatible with this module.
info "fsevents@2.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning " > @testing-library/react@9.3.0" has unmet peer dependency "react@".
warning " > @testing-library/react@9.3.0" has unmet peer dependency "react-dom@
".
warning " > @testing-library/react-hooks@2.0.3" has unmet peer dependency "react@>=16.9.0".
warning " > enzyme-adapter-react-16@1.15.1" has unmet peer dependency "react@^16.0.0-0".
warning " > enzyme-adapter-react-16@1.15.1" has unmet peer dependency "react-dom@^16.0.0-0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils@1.12.1" has unmet peer dependency "react@0.13.x || 0.14.x || ^15.0.0-0 || ^16.0.0-0".
warning " > react-test-renderer@16.10.2" has unmet peer dependency "react@^16.0.0".
warning "enzyme-adapter-react-16 > enzyme-adapter-utils > airbnb-prop-types@2.15.0" has unmet peer dependency "react@^0.14 || ^15.0.0 || ^16.0.0-alpha".
warning " > eslint-plugin-redux-saga@1.1.1" has unmet peer dependency "redux-saga@>= 0.11.1 < 1 || >= 1.0.0".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > @buffetjs/core@1.1.3" has unmet peer dependency "lodash@^4.17.11".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > @buffetjs/custom@1.1.3" has unmet peer dependency "lodash@^4.17.11".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > @buffetjs/utils@1.1.0" has unmet peer dependency "lodash@^4.17.15".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > bootstrap@4.3.1" has unmet peer dependency "jquery@1.9.1 -
3".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > bootstrap@4.3.1" has unmet peer dependency "popper.js@^1.14.7".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-connector-bookshelf > bookshelf@1.0.1" has unmet peer dependency "knex@>=0.15.0 <0.20.0".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-plugin-graphql > graphql-type-long@0.1.1" has incorrect peer dependency "graphql@^0.9.1 || ^0.10.0 || ^0.12.0 || ^0.13.0".
warning "workspace-aggregator-e1cdb685-8760-40c0-9eaf-0dd0b780e80b > strapi-admin > @buffetjs/core > react-dates@21.3.1" has unmet peer dependency "react-with-direction@^1.3.1".
[##----------------------------------------------------------------------------------------------------------------------------------] 35/2723d[5/5] Building fresh packages...
Done in 712.88s.

@derrickmehaffy
Copy link
Member

@heavenkiller2018 microsoft/WSL#2448

It would appear you are not the only one, as I am not a windows guy (linux as my daily OS) not sure of how much help I can be here. My best guess is windows sticking their hand in the cookie jar where they shouldn't be and it's most likely permissions issue. Linux and Windows have never played nice together with regards to permissions.

@derrickmehaffy
Copy link
Member

Ah just saw that you fixed it @heavenkiller2018 nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants