icodelifee / TUF-Control

A Keyboard Lighting And Fan Mode Controller GUI App For hackbnw/faustus Driver Module Built With Electron
21 stars 1 forks source link

Debian packaging instructions not working #2

Open JORGETECH opened 4 years ago

JORGETECH commented 4 years ago

When trying the command "npm run-script build" the build fails with this output:

> tufcontrol-electron@1.0.0 build /home/jorgetech/Temp/TUF-Control
> electron-packager . tufcontrol-electron --platform linux --arch x64 --out dist/

Cannot find module 'electron' from '/home/jorgetech/Temp/TUF-Control'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! tufcontrol-electron@1.0.0 build: `electron-packager . tufcontrol-electron --platform linux --arch x64 --out dist/`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the tufcontrol-electron@1.0.0 build 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!     /home/jorgetech/.npm/_logs/2020-05-20T16_28_04_605Z-debug.log

Output of the debug log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run-script', 'build' ]
2 info using npm@6.14.4
3 info using node@v10.19.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle tufcontrol-electron@1.0.0~prebuild: tufcontrol-electron@1.0.0
6 info lifecycle tufcontrol-electron@1.0.0~build: tufcontrol-electron@1.0.0
7 verbose lifecycle tufcontrol-electron@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle tufcontrol-electron@1.0.0~build: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/jorgetech/Temp/TUF-Control/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
9 verbose lifecycle tufcontrol-electron@1.0.0~build: CWD: /home/jorgetech/Temp/TUF-Control
10 silly lifecycle tufcontrol-electron@1.0.0~build: Args: [ '-c',
10 silly lifecycle   'electron-packager . tufcontrol-electron --platform linux --arch x64 --out dist/' ]
11 silly lifecycle tufcontrol-electron@1.0.0~build: Returned: code: 1  signal: null
12 info lifecycle tufcontrol-electron@1.0.0~build: Failed to exec build script
13 verbose stack Error: tufcontrol-electron@1.0.0 build: `electron-packager . tufcontrol-electron --platform linux --arch x64 --out dist/`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:198:13)
13 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:198:13)
13 verbose stack     at maybeClose (internal/child_process.js:982:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
14 verbose pkgid tufcontrol-electron@1.0.0
15 verbose cwd /home/jorgetech/Temp/TUF-Control
16 verbose Linux 5.6.13-050613-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run-script" "build"
18 verbose node v10.19.0
19 verbose npm  v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error tufcontrol-electron@1.0.0 build: `electron-packager . tufcontrol-electron --platform linux --arch x64 --out dist/`
22 error Exit status 1
23 error Failed at the tufcontrol-electron@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I'm using Ubuntu 20.04

ferretwithaberet commented 4 years ago

Not sure if this is the issue, seems like it but he forgot to mention that you need to install the dependencies of the project using npm install in the TUF-control folder, then you can continue from npm run-script build.

icodelifee commented 4 years ago

Not sure if this is the issue, seems like it but he forgot to mention that you need to install the dependencies of the project using npm install in the TUF-control folder, then you can continue from npm run-script build.

yea sorry i forgot to mention, i have some commits which i will push after my exams, including packages in release!

JORGETECH commented 4 years ago

I followed @RadoiAndrei advice and I can confirm the sudo npm install command solves the issue of missing dependencies, it's also a good idea to add sudo to all the npm install commands in the docs since most people are going to use that nowadays (instead of a root shell). Another important observation is that the dist folder in amd64 systems is named "tufcontrol-electron-linux-x64" not "tufcontrol-electron".

The app works great, congratulations @icodelifee !

ferretwithaberet commented 4 years ago

I followed @RadoiAndrei advice and I can confirm the sudo npm install command solves the issue of missing dependencies, it's also a good idea to add sudo to all the npm install commands in the docs since most people are going to use that nowadays (instead of a root shell). Another important observation is that the dist folder in amd64 systems is named "tufcontrol-electron-linux-x64" not "tufcontrol-electron".

The app works great, congratulations @icodelifee !

sudo is only meant to be used when you want a command to be run as the root user. I for example use node version manager installed locally to my user which doesn't require me to use sudo. If your node is installed on the root user, then sure use sudo, using sudo while not having node installed on the root user will just tell you that the command was not found.