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

Install fails : "ynh_npm: command not found" #107

Closed
Gofannon opened this issue Nov 14, 2021 · 8 comments · Fixed by #108 or #109
Closed

Install fails : "ynh_npm: command not found" #107

Gofannon opened this issue Nov 14, 2021 · 8 comments · Fixed by #108 or #109

Comments

@Gofannon
Copy link

Describe the bug

Hello there,

I tried to install kresus from the web interface and I get the error in the logs: 2021-11-14 14:39:55,928: DEBUG - /usr/share/yunohost/helpers.d/logging: line 143: ynh_npm: command not found

Context

  • Hardware: dedicated server rented : kimsufi box
  • YunoHost version: 4.3.2.2
  • I have access to my server: Through SSH and webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Using, or trying to install package version/branch: kresus package

If it can help, I tried to install the package a few months ago and has the same issue described here: #106

Steps to reproduce

  • Install Kresus from webadmin with these parameters:

kresus

Expected behavior

Kresus should be installed

Logs

full log: https://paste.yunohost.org/gehofasiqo.sql

Extract:

2021-11-14 14:39:55,402: INFO - [############+.......] > Installing app
2021-11-14 14:39:55,407: DEBUG - + ynh_use_nodejs
2021-11-14 14:39:55,409: DEBUG - ++ ynh_app_setting_get --app=kresus --key=nodejs_version
2021-11-14 14:39:55,410: DEBUG - ++ local _globalapp=kresus
2021-11-14 14:39:55,535: DEBUG - ++ app=kresus
2021-11-14 14:39:55,536: DEBUG - ++ [[ nodejs_version =~ (unprotected|protected|skipped)_ ]]
2021-11-14 14:39:55,538: DEBUG - ++ ynh_app_setting get kresus nodejs_version
2021-11-14 14:39:55,754: DEBUG - + nodejs_version=14
2021-11-14 14:39:55,756: DEBUG - + nodejs_path=/opt/node_n/n/versions/node/14/bin
2021-11-14 14:39:55,757: DEBUG - + shopt -s expand_aliases
2021-11-14 14:39:55,758: DEBUG - + ynh_node=/opt/node_n/n/versions/node/14/bin/node
2021-11-14 14:39:55,759: DEBUG - + alias ynh_node=/opt/node_n/n/versions/node/14/bin/node
2021-11-14 14:39:55,760: DEBUG - + ynh_npm=/opt/node_n/n/versions/node/14/bin/npm
2021-11-14 14:39:55,760: DEBUG - + alias ynh_npm=/opt/node_n/n/versions/node/14/bin/npm
2021-11-14 14:39:55,761: DEBUG - + [[ :/opt/node_n/n/versions/node/14/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin: != *\:\/\o\p\t\/\n\o\d\e\_\n\/\n\/\v\e\r\s\i\o\n\s\/\n\o\d\e\/\1\4\/\b\i\n* ]]
2021-11-14 14:39:55,762: DEBUG - + node_PATH=/opt/node_n/n/versions/node/14/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2021-11-14 14:39:55,763: DEBUG - + ynh_node_load_PATH=PATH=/opt/node_n/n/versions/node/14/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2021-11-14 14:39:55,764: DEBUG - + ynh_node_load_path=PATH=/opt/node_n/n/versions/node/14/bin:/opt/node_n/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
2021-11-14 14:39:55,764: DEBUG - + cd /var/www/kresus
2021-11-14 14:39:55,765: DEBUG - + chown -R kresus: /var/www/kresus
2021-11-14 14:39:55,924: DEBUG - + ynh_exec_warn_less ynh_npm install --production --unsafe-perm
2021-11-14 14:39:55,926: DEBUG - + [[ 4 -eq 1 ]]
2021-11-14 14:39:55,927: DEBUG - + ynh_npm install --production --unsafe-perm
2021-11-14 14:39:55,928: DEBUG - /usr/share/yunohost/helpers.d/logging: line 143: ynh_npm: command not found
2021-11-14 14:39:55,930: DEBUG - + ynh_exit_properly
2021-11-14 14:39:55,932: DEBUG - + local exit_code=127
2021-11-14 14:39:55,945: DEBUG - + '[' 127 -eq 0 ']'
2021-11-14 14:39:57,474: ERROR - Impossible d'installer kresus : Une erreur est survenue dans le script d'installation de l'application
@nicofrand
Copy link
Collaborator

nicofrand commented Nov 15, 2021

Hi!

Weird. What's the output of ls -la "/opt/node_n/n/versions/node/14/bin/npm"?

@Gofannon
Copy link
Author

Hello,

Here you go:

root@yuno:~# ls -la "/opt/node_n/n/versions/node/14/bin/npm"
lrwxrwxrwx 1 root root 38 Oct 12 04:07 /opt/node_n/n/versions/node/14/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
root@yuno:~# which ynh_npm
root@yuno:~# whereis ynh_npm
ynh_npm:
root@yuno:~# 

@tituspijean tituspijean mentioned this issue Nov 16, 2021
2 tasks
@tituspijean
Copy link
Member

tituspijean commented Nov 16, 2021

I think that's due to the use of the helper after another one (ynh_exec_warn_less ).

Can you try installing my attempt at a fix? yunohost app install https://github.com/YunoHost-Apps/kresus_ynh/tree/fix-ynh_npm -f

Edit: Tested on my end, no issues.

@nicofrand
Copy link
Collaborator

Possible regression from YunoHost/yunohost#1358?

@Gofannon
Copy link
Author

Gofannon commented Nov 17, 2021

Can you try installing my attempt at a fix? yunohost app install https://github.com/YunoHost-Apps/kresus_ynh/tree/fix-ynh_npm -f

It works now but I end up with the error node-gyp rebuild. Same as here #71 (comment) (I use a kimsufi server too)

Info: Installing kresus...
Info: [+...................] > Validating installation parameters...
Info: [#+..................] > Storing installation settings...
Info: [##++................] > Finding an available port...
Info: [####+...............] > Installing app dependencies
Info: [#####+..............] > Setting up source files...
Info: [######++............] > Configuring NGINX web server...
Info: [########+...........] > Creating system user
Info: [#########+..........] > Installing nodejs
Info: [##########++........] > Installing woob
Info: [############+.......] > Installing app
Error: Unable to install kresus: An error occurred inside the app installation script
Info: The operation 'Install the 'kresus' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20211117-190136-app_install-kresus' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - gyp ERR! node -v v14.18.1
Info: DEBUG - gyp ERR! node-gyp -v v5.1.0
Info: DEBUG - gyp ERR! not ok
Info: DEBUG - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/@nicolo-ribaudo/chokidar-2/node_modules/chokidar/node_modules/fsevents):
Info: DEBUG - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Info: DEBUG - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
Info: DEBUG - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Info: DEBUG - npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/mocha/node_modules/chokidar/node_modules/fsevents):
Info: DEBUG - npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
Info: DEBUG -
Info: DEBUG - npm ERR! code ELIFECYCLE
Info: DEBUG - npm ERR! errno 1
Info: DEBUG - npm ERR! [email protected] install: `node-gyp rebuild`
Info: DEBUG - npm ERR! Exit status 1
Info: DEBUG - npm ERR!
Info: DEBUG - npm ERR! Failed at the [email protected] install script.
Info: DEBUG - npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Info: DEBUG -
Info: DEBUG - npm ERR! A complete log of this run can be found in:
Info: DEBUG - npm ERR!     /root/.npm/_logs/2021-11-17T19_06_49_041Z-debug.log
Info: DEBUG - + ynh_exit_properly
Warning: Removing the app following the installation failure...
Info: [+++.................] > Removing systemd configuration
Info: [###+++..............] > Removing associated database
Warning: cat: /etc/yunohost/psql: No such file or directory
Warning: Database  not found
Warning: cat: /etc/yunohost/psql: No such file or directory
Warning: User  not found
Info: [######++++..........] > Removing dependencies
Info: [##########+++.......] > Removing NGINX configuration
Info: [#############+++....] > Removing the dedicated system user...
Info: [####################] > Removal of kresus completed
Error: The operation 'Install the 'kresus' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share XXX-kresus' to get help
root@yuno:~# 

I can try commands listed here maybe? #71 (comment)

edit: add install logs https://paste.yunohost.org/tejeleziro.bash

@ericgaspar ericgaspar mentioned this issue Nov 29, 2021
@ImaCrea
Copy link

ImaCrea commented Dec 10, 2021

fyi (in case it may help) Tried to install with the testing branch. Installation seemed to go well but when I try to open the app I get a 502 error. Keep it up ✌️

@nicofrand
Copy link
Collaborator

Hi,

A 502 error is different. Can you provide the logs please?

@ImaCrea
Copy link

ImaCrea commented Feb 17, 2022

(sorry for not answering. I didn't have the time to get back into it.)

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

Successfully merging a pull request may close this issue.

4 participants