peerDependencies txawv. Lawv tsis tau nruab. Thaum ib qho kev vam khom tau teev nyob rau hauv ib pob raws li peerDependency, nws tsis tau nruab. Hloov chaw, tus lej uas suav nrog pob yuav tsum suav nrog nws raws li nws qhov kev vam khom.
Kuv puas yuav tsum tau teeb tsa txhua tus neeg nyob sib ze?
Nws muaj tseeb tias zam ntau qhov kev txhim kho ntawm ib pob yog ib lub hom phiaj ntawm peerDependencies, tab sis kev vam meej tsuas yog de-duplicated yog tias cov versions tau sib xws. Yog tias lawv tsis sib xws, koj tseem yuav tau txais ntau lub versions ntsia.
Puas yog cov neeg muaj kev vam khom tau nruab?
UPDATE: npm versions 1, 2, thiab 7 yuav cia li nruab peerDependencies yog tias lawv tsis meej meej nyob ntawm qhov siab dua ntawm tsob ntoo nyob. Rau npm versions 3 txog 6, koj yuav tau txais lus ceeb toom tias cov peerDependency tsis tau nruab.
Thaum twg kuv yuav tsum siv cov neeg nyob sib ze?
Thaum twg koj yuav tsum siv cov neeg nyob sib ze?
- Thaum koj tab tom tsim tsev qiv ntawv kom siv los ntawm lwm cov haujlwm, thiab.
- lub tsev qiv ntawv no siv qee lub tsev qiv ntawv, thiab.
- Koj xav tau / xav tau tus neeg siv los ua haujlwm nrog lwm lub tsev qiv ntawv thiab.
Pob NPM puas nruab kev vam khom?
Los ntawm lub neej ntawd, npm nruab yuav nruab tag nrho cov modules teev raws li kev vam khom hauv pob. json. Nrog rau tus chij --production (los yog thaum NODE_ENV ib puag ncig hloov pauv tau teeb tsa rau ntau lawm), npm yuav tsis nruab modules teev nyob rau hauv devDependencies.