Je rencontre un problème qui me donne mal à la tête depuis des heures déjà. Je travaille sur une application mobile que je développe dans un environnement nativescript. Comme mon application doit décoder les jetons Web JSON à des fins de connexion, j'ai essayé d'installer le paquet jsonwebtoken npm, qui ne semble pas compatible avec nativescript. Après quelques google je trouve le « nativescript-nodeify'-plugin que j'ai installé viaImpossible d'installer les paquets npm dans le projet nativescript (..après l'installation de nativescript-nodeify?)
tns plugin add nativescript-nodeify
Après que tout semblait bien fonctionner, mais plus tard j'ai essayé d'installer un autre paquet, ce qui m'a donné l'erreur suivante:
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "nativescript-nodeify/node_modules/string_decoder": name can only contain URL-friendly characters
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jonas/.npm/_logs/2017-10-06T16_24_33_241Z-debug.log
Ceci est le contenu du fichier journal:
0 info it worked if it ends with ok
1 verbose cli [ '/home/jonas/.nvm/versions/node/v6.11.3/bin/node',
1 verbose cli '/home/jonas/.nvm/versions/node/v6.11.3/bin/npm',
1 verbose cli 'install',
1 verbose cli 'file-system',
1 verbose cli '--save' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session d7333b71d2cd0141
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 http fetch GET 304 https://registry.npmjs.org/file-system 216ms (from cache)
8 silly pacote tag manifest for [email protected] fetched in 238ms
9 silly install loadIdealTree
10 silly install cloneCurrentTreeToIdealTree
11 silly install loadShrinkwrap
12 silly install loadAllDepsIntoIdealTree
13 silly resolveWithNewModule [email protected] checking installable status
14 http fetch GET 304 https://registry.npmjs.org/utils-extend 164ms (from cache)
15 silly pacote range manifest for [email protected]^1.0.4 fetched in 166ms
16 silly resolveWithNewModule [email protected] checking installable status
17 http fetch GET 304 https://registry.npmjs.org/file-match 171ms (from cache)
18 silly pacote range manifest for [email protected]^1.0.1 fetched in 172ms
19 silly resolveWithNewModule [email protected] checking installable status
20 verbose stack Error: Invalid package name "nativescript-nodeify/node_modules/string_decoder": name can only contain URL-friendly characters
20 verbose stack at invalidPackageName (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:71:15)
20 verbose stack at Object.Result.setName (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:107:11)
20 verbose stack at Object.Result (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:96:23)
20 verbose stack at Function.resolve (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:45:15)
20 verbose stack at childDependencySpecifier (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/lib/install/deps.js:81:14)
20 verbose stack at addDependency (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/lib/install/deps.js:532:15)
20 verbose stack at /home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/lib/install/deps.js:482:5
20 verbose stack at /home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
20 verbose stack at Array.forEach (native)
20 verbose stack at /home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
20 verbose stack at Array.forEach (native)
20 verbose stack at asyncMap (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
20 verbose stack at loadDeps (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/lib/install/deps.js:474:3)
20 verbose stack at Array.<anonymous> (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
20 verbose stack at LOOP (/home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
20 verbose stack at /home/jonas/.nvm/versions/node/v6.11.3/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
21 verbose cwd /home/jonas/Dokumente/Telemedizin-Bachelorarbeit-JF/medicalIM
22 verbose Linux 4.4.0-42-generic
23 verbose argv "/home/jonas/.nvm/versions/node/v6.11.3/bin/node" "/home/jonas/.nvm/versions/node/v6.11.3/bin/npm" "install" "file-system" "--save"
24 verbose node v6.11.3
25 verbose npm v5.4.2
26 error code EINVALIDPACKAGENAME
27 error Invalid package name "nativescript-nodeify/node_modules/string_decoder": name can only contain URL-friendly characters
28 verbose exit [ 1, true ]
J'ai essayé de désinstaller nativescript-nodeify via
tns plugin remove nativescript-nodeify
qui semble aussi utiliser la NPM-commande et échoue:
Command failed: npm uninstall nativescript-nodeify --save
npm ERR! code EINVALIDPACKAGENAME
npm ERR! Invalid package name "util/util.js": name can only contain URL-friendly characters
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jonas/.npm/_logs/2017-10-06T16_01_14_047Z-debug.log
Je suis retourné quelques commits (avant d'installer nodeify) et la NPM installer commande fonctionne comme prévu. Comme j'ai besoin de ces paquets dans mon projet, ce serait génial si quelqu'un avait une solution pour faire fonctionner nativescript-nodeify correctement ou une alternative à cela.
Merci d'avance;)
avez-vous compris pourquoi il faisait ça? Avez-vous trouvé une solution ? – ThomasP1988