paulsutherland / Polyonic

An Electron Ionic application shell for creating Web Apps, Progressive Mobile Web Apps, Native Mobile Apps and Desktop Apps.
209 stars 44 forks source link

'npm install' don't run fine on ubuntu #11

Closed AlexVFornazieri closed 7 years ago

AlexVFornazieri commented 7 years ago

Hello guys,

First of all, congratulations, I was in need of a project with this proposal, but I'm not getting started, I hope you can help me.

When running for first time 'npm install' on Ubuntu, the following error is being handled by installing the dependencies: npm ERR! code EAI_AGAIN npm ERR! errno EAI_AGAIN npm ERR! request to https://registry.npmjs.org/tslint/-/tslint-5.4.2.tgz failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

On a second attempt: $ npm install npm WARN deprecated tslint-stylish@2.1.0: Replaced by core tslint formatter npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

fcopy-pre-bundled@0.3.4 install /home/abelha/Abelha.network/Polyonic/node_modules/fcopy-pre-bundled echo ''

electron@1.6.11 postinstall /home/abelha/Abelha.network/Polyonic/node_modules/electron node install.js

polyonic@1.0.0 postinstall /home/abelha/Abelha.network/Polyonic electron-builder install-app-deps

electron-builder 19.13.0 Error: Application directory build doesn't exists at /home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/src/util/config.ts:279:13 From previous event: at computeDefaultAppDirectory (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/out/util/config.js:236:22) at /home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/src/cli/install-app-deps.ts:45:78 at next (native) at runCallback (timers.js:672:20) at tryOnImmediate (timers.js:645:5) at processImmediate [as _immediateCallback] (timers.js:617:5) From previous event: at installAppDeps (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/out/cli/install-app-deps.js:43:21) at Object.args [as handler] (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/src/cli/cli.ts:41:4) at Object.self.runCommand (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/node_modules/yargs/lib/command.js:233:22) at Object.Yargs.self._parseArgs (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/node_modules/yargs/yargs.js:990:30) at Object.get [as argv] (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/node_modules/yargs/yargs.js:927:19) at Object. (/home/abelha/Abelha.network/Polyonic/node_modules/electron-builder/src/cli/cli.ts:36:15) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.runMain (module.js:604:10) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:504:3 npm ERR! code ELIFECYCLE npm ERR! errno 255 npm ERR! polyonic@1.0.0 postinstall: electron-builder install-app-deps npm ERR! Exit status 255 npm ERR! npm ERR! Failed at the polyonic@1.0.0 postinstall script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Environmental Data OS: Ubuntu 16.04 node -v 6.11.0 npm --version 5.1.0

paulsutherland commented 7 years ago

Hi,

It seems to be missing the build directory:

Error: Application directory build doesn't exists

I have added a .gitkeep to ensure the build directory is in a fresh repo.

Try pulling and building again.

Cheers..

Paul

jean-merelis commented 7 years ago

I had the same problem, but now the "npm install" runs endlessly until the system hangs. The system monitor displays a lot of npm instances running.

paulsutherland commented 7 years ago

Ok, I'll setup a fresh Ubuntu VM at the weekend and test this out.

It does look like an NPM issue, so can you help me out by letting me know what versions of following you are running:

Ubuntu Node NPM

Thanks,

Paul

paulsutherland commented 7 years ago

Hello @AlexVFornazieri @jean-merelis,

I managed to recreate the issues you were having. It was a problem with electron-builder. Removing the post install script resolved this. There were also a couple of file references that were incorrect in the gulp build scripts.

Anyway, I have update the repo, so please pull down the latest copy and try again.

FYI, on Ubuntu I had an ENOSPC issue - similar to #8. To work around this, you will need to increase the number of file watchers to allow gulp to work.

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

I have updated the README to reference this ENOSPC issue.

Also, you need to ensure you have build-essential installed as per: Installing Node.js via package manager

sudo apt-get install -y build-essential

Let me know if this resolves your build troubles so that I can close this issue.

FYI I tested this on:

Ubuntu 16:04 LTS Node 6.11.1 LTS NPM 3.10.10

Many thanks for the feedback 😄

jean-merelis commented 7 years ago

Hello @paulsutherland Thanks a lot for the help. After increasing the number of file watchers, it works fine now.

My environment: Ubuntu 16.04 Node v6.11.1 NPM 3..10.10

Thank you again.