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

Can not deploy to Digital Ocean droplets, error when run setup #1573

Closed
ghufr opened this issue Jul 14, 2018 · 10 comments
Closed

Can not deploy to Digital Ocean droplets, error when run setup #1573

ghufr opened this issue Jul 14, 2018 · 10 comments
Assignees

Comments

@ghufr
Copy link

ghufr commented Jul 14, 2018

Informations

  • Node.js version: 9.11.1 (i use nvm)
  • npm version: 5.6.0
  • Strapi version: 3.0.0-alpha.12.6
  • Database: mongo
  • Operating system: Ubuntu 16.04.4 LTS

What is the current behavior?

 91% additional asset processingnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! strapi-admin@3.0.0-alpha.12.6 build: `APP_PATH=$APP_PATH npm run build:dll && node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=production IS_ADMIN=true node ./node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config ./node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the strapi-admin@3.0.0-alpha.12.6 build 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/2018-07-14T12_16_44_741Z-debug.log
(node:14349) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
 91% additional asset processingnpm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! strapi-admin@3.0.0-alpha.12.6 build: `APP_PATH=$APP_PATH npm run build:dll && node ./node_modules/strapi-helper-plugin/node_modules/.bin/cross-env NODE_ENV=production IS_ADMIN=true node ./node_modules/strapi-helper-plugin/node_modules/.bin/webpack --config ./node_modules/strapi-helper-plugin/lib/internals/webpack/webpack.prod.babel.js --color -p --progress`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the strapi-admin@3.0.0-alpha.12.6 build 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/2018-07-14T12_16_44_741Z-debug.log

Steps to reproduce the problem

  • Create Digital Ocean droplets (1vCPU 1GB)
  • npm i -g strapi@3.0.0-alpha.12.6
  • strapi new myProject
  • cd ./myProject
  • npm run setup

What is the expected behavior?

  • Build without error

Suggested solutions

  • Scale the Digital Ocean droplets ? 🤷‍♂️
  • Using docker? (Build local)

I already test to build on my linux machine but it works without error

Resource usage when building:
2018-07-14 19_51_18-window

@ghufr ghufr changed the title Can not deploy on Digital Ocean droplets, error when run setup Can not deploy to Digital Ocean droplets, error when run setup Jul 14, 2018
@derrickmehaffy
Copy link
Member

@ghufr can you test without using nvm and install node globally?

@ghufr
Copy link
Author

ghufr commented Jul 14, 2018

@derrickmehaffy I use nvm on my local machine, same version and it works

@ghufr
Copy link
Author

ghufr commented Jul 14, 2018

I tried to npm run build on admin folder, it works fine, but the plugins is not built

@derrickmehaffy
Copy link
Member

@ghufr try to run that in the root project directory

@derrickmehaffy
Copy link
Member

sorry npm run setup

@derrickmehaffy
Copy link
Member

Just tossing this here since @maturano noticed it put it on the slack. @soupette any idea whats going on here?

Maturano [11 days ago]
... 😕

Results that...

  • cross-env is dependency of strapi-helper-plugin
  • strapi-helper-plugin is listed on devDependecies

... In the server the var enviroment NODE_ENV=production is setted by default. That was causing to npm skip installing the devDependencies... so ... that was the black magic.

I'll out to walk a couple of minutes U_U

@maturanomx
Copy link
Contributor

maturanomx commented Jul 16, 2018

I just had experiment the same issue (again) and this time my NODE_ENV variable was undefined ... maybe is the same problem here.

@ghufr Try to set the environment variable npm_config_debug to true, hopefully you can see a more verbose output that could help find the problem:

$ npm_config_debug=true npm run setup

In my case, I got this:

> pngquant-bin@4.0.0 postinstall /project/admin/node_modules/pngquant-bin
> node lib/install.js 

⚠ The `/project/admin/node_modules/pngquant-bin/vendor/pngquant` binary doesn't seem to work correctly  
⚠ pngquant pre-build test failed  
ℹ compiling from source  
✔ pngquant pre-build test passed successfully  
✖ HTTPError: pngquant failed to build, make sure that libpng-dev is installed
    at EventEmitter.ee.on.res (/project/admin/node_modules/pngquant-bin/node_modules/got/index.js:250:24)
    at EventEmitter.emit (events.js:180:13)
    at Immediate.setImmediate (/project/admin/node_modules/pngquant-bin/node_modules/got/index.js:99:8)
    at runCallback (timers.js:763:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate (timers.js:716:5)

My problem was that I was connected behind an "enterprise restricted network" (an HTTPError). I don't know why is connecting to internet if I had all the dependencies installed... in fact, I had pngquant installed, the building should not happen at all 😕, but well, I changed of network and then works.

That error was interrupting the installation of dependencies and ending with the same error... 😫

My 2c

@ghufr
Copy link
Author

ghufr commented Jul 19, 2018

It turns out my problem is caused by memory limit :(

@ghufr ghufr closed this as completed Jul 19, 2018
@seanmavley
Copy link

@ghufr That's a great hint.

I'm on a 5$ digitalocean box. Instead of upgrading, just bumped up swapfile from 1 to 2Gig. Sailed through in peace.

@niallmurphy-ie
Copy link

Thanks @seanmavley Adding a swapfile solved my issue, too.

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

No branches or pull requests

7 participants