web-dev-qa-db-fra.com

npm - utilisation de données de paquet périmées

Chaque fois que je fais une installation npm, je reçois une tonne de messages à ce sujet en utilisant des données de paquet périmées. Qu'est-ce que cela signifie et est-ce quelque chose qui doit m'inquiéter?

Voici un petit exemple des messages d’avertissement que j’obtiens avec une installation de npm. Dans cet exemple particulier, je viens d'ajouter "npm install @ angular/animations @ latest --save":

WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0
g== integrity checksum failed when using sha512: wanted sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g== but got sha1-2+xJQ20q4V9TYRTnbRRlbNvA9E0
=. (8538 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUu
g== integrity checksum failed when using sha512: wanted sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug== but got sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g
=. (3618 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0
g== integrity checksum failed when using sha512: wanted sha512-Mp+FXEI+FrwY/XYV45b2YD3E8i3HwnEAoFcM0qlZzq/RZ9RwWitt2Y/c7cqRAz70U7hfekqx6qNYthuKFO6K0g== but got sha1-2+xJQ20q4V9TYRTnbRRlbNvA9E0
=. (8538 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUu
g== integrity checksum failed when using sha512: wanted sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug== but got sha1-wVm41b4PnlpvNG2rlPFs4CIWG4g
=. (3618 bytes)
WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.

Voici le fichier package.json actuel que j'ai pour mon projet:

{
  "name": "myproject",
  "version": "0.0.1",
  "license": "me",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --extract-css true",
    "build-prod": "ng build -prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "update:packages": "node wipe-dependencies.js && rm -rf node_modules && npm update --save-dev && npm update --save",
    "prestyleguide": "ng build --extract-css true",
    "styleguide": "rimraf dist/styleguide/ && kss --config kss/kss-config.json --custom hidemarkup --custom hideexample --custom hidedefault --custom fakeexample --placeholder .modifier-class",
    "//": "Build just the styleguide without building the entire app (requires that the app has already been built to the dist/ folder)",
    "build-styleguide": "rimraf dist/styleguide/ && kss --config kss/kss-config.json --custom hidemarkup --custom hideexample --custom hidedefault --custom fakeexample --placeholder .modifier-class"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^4.3.3",
    "@angular/common": "^4.3.2",
    "@angular/compiler": "^4.3.2",
    "@angular/core": "^4.3.2",
    "@angular/forms": "^4.3.2",
    "@angular/http": "^4.3.2",
    "@angular/platform-browser": "^4.3.2",
    "@angular/platform-browser-dynamic": "^4.3.2",
    "@angular/router": "^4.3.2",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.28",
    "bootstrap": "^4.0.0-alpha.6",
    "classlist.js": "^1.1.20150312",
    "core-js": "^2.4.1",
    "font-awesome": "^4.7.0",
    "ngx-mydatepicker": "^2.0.12",
    "rxjs": "^5.4.2",
    "web-animations-js": "^2.3.1",
    "zone.js": "^0.8.16"
  },
  "devDependencies": {
    "@angular/cli": "^1.2.3",
    "@angular/compiler-cli": "^4.3.2",
    "@types/jasmine": "^2.5.53",
    "@types/node": "^8.0.15",
    "codelyzer": "^3.1.2",
    "fs-extra": "^4.0.0",
    "jasmine-core": "^2.6.4",
    "jasmine-spec-reporter": "^4.1.1",
    "karma": "^1.7.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-cli": "^1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "^1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "kss": "^3.0.0-beta.18",
    "protractor": "^5.1.2",
    "random-ext": "^2.5.1",
    "ts-node": "^3.2.1",
    "tslint": "^5.5.0",
    "typedoc": "^0.7.1",
    "TypeScript": "^2.4.2"
  }
}
47
BlueCaret

essayez cela puis réinstallez toutes les dépendances de votre projet

rm ./package-lock.json
rm -r ./node_modules
npm cache clear --force

Il y a un fil complet sur github à ce sujet, depuis juin je pense

86
sheplu

Depuis npm 5, vous n’avez pas le contrôle total sur le cache, vous pouvez donc essayer pour npm 5

npm cache verify

Cela m'a aidé. Je ne pense pas que vous deviez supprimer package-lock et node_modules dans un premier temps. 

15
s-f

Si la méthode d'effacement du cache ne fonctionne pas ...

J'ai constaté que j'avais ce problème lors d'une mise à jour d'OS X. L'installation de la mise à jour des outils de ligne de commande et le redémarrage d'iTerm ont résolu ce problème de manière incroyable.

 unexpected causes

Certainement pas suggérer que ceci est une solution "appropriée" mais était en train de déconner avec ma configuration (pomme wtf?). Posté dans le cas où quelqu'un d'autre regarderait c'est dans la même position ????????

2
Ralph Cowling

J'ai eu cette erreur lors de l'utilisation d'un registre personnalisé (pas npmjs.org). Le problème était que mon registre était en panne.

0
AJ Richardson

Vous pouvez essayer d'effacer votre cache npm en utilisant Npm cache clear --force

Puis réinstallez vos modules de noeud

J'espère que ça aide.

0
Treasure