Bonjour à tous,
Je débute avec NodeJS et je suis vraiment bloqué car NPM ne veut pas fonctionner (même npm -v).
Je pense que c'est un problème d'accès ou de lien mais tout me semble correct.
Voici des infos sur mon problème: node -v fonctionne mais pas npm -v.
(Pour info, c'est sur un IBM i - AS400, mais ce ne change rien).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# alternatives --display node
node - auto mode
  link best version is /QOpenSys/pkgs/lib/nodejs12/bin/node
  link currently points to /QOpenSys/pkgs/lib/nodejs12/bin/node
  link node is /QOpenSys/pkgs/bin/node
  slave npm is /QOpenSys/pkgs/bin/npm
  slave npx is /QOpenSys/pkgs/bin/npx
/QOpenSys/pkgs/lib/nodejs12/bin/node - priority 12
  slave npm: /QOpenSys/pkgs/lib/nodejs12/bin/npm
  slave npx: /QOpenSys/pkgs/lib/nodejs12/bin/npx
#
# ls -la /QOpenSys/pkgs/bin/node
lrwxrwxrwx 1 qsecofr 0 62 Feb 10 15:13 /QOpenSys/pkgs/bin/node -> /QOpenSys/etc/alternatives/node
# ls -la /QOpenSys/pkgs/bin/npm
lrwxrwxrwx 1 qsecofr 0 60 Feb 10 15:13 /QOpenSys/pkgs/bin/npm -> /QOpenSys/etc/alternatives/npm
#  ls -la /QOpenSys/pkgs/bin/npx
lrwxrwxrwx 1 qsecofr 0 60 Feb 10 15:13 /QOpenSys/pkgs/bin/npx -> /QOpenSys/etc/alternatives/npx
#
# ls -la /QOpenSys/etc/alternatives/node
lrwxrwxrwx 1 qsecofr 0 72 Feb 10 15:13 /QOpenSys/etc/alternatives/node -> /QOpenSys/pkgs/lib/nodejs12/bin/node
# ls -la /QOpenSys/etc/alternatives/npm
lrwxrwxrwx 1 qsecofr 0 70 Feb 10 15:13 /QOpenSys/etc/alternatives/npm -> /QOpenSys/pkgs/lib/nodejs12/bin/npm
# ls -la /QOpenSys/etc/alternatives/npx
lrwxrwxrwx 1 qsecofr 0 70 Feb 10 15:13 /QOpenSys/etc/alternatives/npx -> /QOpenSys/pkgs/lib/nodejs12/bin/npx
#
Everything looks fine !
Tout semble correct !

Now, what’s really strange is that npm is running correctly under the path: /QOpenSys/pkgs/bin
Maintenant, ce qui est vraiment étrange est que npm fonctionne correctement sous le chemin : /QOpenSys/pkgs/bin

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# pwd
/home/QSECOFR
# node -v
v12.22.9
# npm -v
node: No such file or directory
# cd /QOpenSys/pkgs/bin/
# pwd
/QOpenSys/pkgs/bin
# npm -v
6.14.15
# echo $PATH
/QOpenSys/pkgs/bin:/QOpenSys/usr/bin:/usr/ccs/bin:/QOpenSys/usr/bin/X11:/usr/sbin:.:/usr/bin
#
#
# cd /home/QSECOFR
# pwd
/home/QSECOFR
# /QOpenSys/pkgs/bin/npm -v
node: No such file or directory
#
Avez-vous une idée du problème ? Probablement un lien ou autre chose manquant mais je ne sais pas quoi !!!

Merci,