Misleading "PRO TIP" about missing "package-lock.json" (with `npm-shrinkwrap.json`)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- go, nodejs
- Ambito
- build-system
Direzione di ricerca
Inizia in src/nodejs/supply/supply.go intorno alle righe 441-463, dove il buildpack verifica package-lock.json e npm-shrinkwrap.json e stampa il PRO TIP. Riproduci il controllo con ciascun file di lock presente e con nessuno dei due presente. Il lavoro è completato quando ciascun file di lock supportato sopprime l'avviso, mentre l'avviso mostrato senza nessuno dei due nomina entrambe le opzioni.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem Description
For our Node.js application, we always receive the following message:
-----> Creating runtime environment
PRO TIP: Warning: package-lock.json not found. The buildpack may reach out to the internet to download module updates, even if they are vendored.
Visit https://docs.cloudfoundry.org/buildpacks/node/index.html#offline_environments
Interestingly, in the next step the logs indicate that a prebuild was succssfully detected:
Prebuild detected (node_modules already exists)
Rebuilding any native modules
rebuilt dependencies successfully
Installing any new modules (package.json + npm-shrinkwrap.json)
We are using a npm-shrinkwrap.json instead of a package-lock.json. To my understanding, they should work the same for vendoring (also see https://stackoverflow.com/a/46132512).
Context
I checked the code that prints this message, and it seems to loop over two files package-lock.json and npm-shrinkwrap.json. The order of the files seems to be important for the following loop.
The loop goes over these files and if it does not find a file, it returns the "PRO TIP".
This does not make any sense for the npm-shrinkwrap.json (as the "PRO TIP" only mentions the package-lock.json).
And I also think it does not make sense to expect both the package-lock.json and npm-shrinkwrap.json (as they are basically the same file in different format).
Expected Behavior
I would expect that when you either have a package-lock.json or npm-shrinkwrap.json it does not show the "PRO TIP" and if none of these files are present the "PRO TIP" is shown and the message includes both options (either having a package-lock.json or npm-shrinkwrap.json).
Maybe, I am also missing something here (but I tried to look when/why the change was implemented and could not find anything that indicates the correctness of the current functionality).
- Lingua principale
- Go
- Stelle
- 174
- Fork
- 389
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di cloudfoundry/nodejs-buildpack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
cloudfoundry/nodejs-buildpack#938 · 2 commenti ·
-
unscheduled
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
cloudfoundry/nodejs-buildpack#683 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
cloudfoundry/nodejs-buildpack#923 ·
-
unscheduled
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
cloudfoundry/nodejs-buildpack#655 · 1 commento ·
-
unscheduled
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
cloudfoundry/nodejs-buildpack#626 · 4 commenti ·
Tutte le issue di cloudfoundry/nodejs-buildpack
Issue simili
-
bug github_actions
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
registrystack/registry-stack#1393 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
JakeChampion/lang#10213 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
oasisprotocol/oasis-sdk#2523 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100