Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

normalize-package-data is not always run on install #7243

Closed
smikes opened this issue Jan 30, 2015 · 1 comment
Closed

normalize-package-data is not always run on install #7243

smikes opened this issue Jan 30, 2015 · 1 comment
Labels
Milestone

Comments

@smikes
Copy link
Contributor

smikes commented Jan 30, 2015

Ref this stack overflow question: https://stackoverflow.com/questions/28173974/node-dependency-package-json-metadata-changing-over-time-for-same-version

It looks like normalize-package-data is not always run on an installed package. The canary here is the absence of a homepage key in package.json, which is added when normalize-package-data is run. Repro set:

$ mkdir test && cd test
$ npm rm is-utf8; npm i is-utf8
unbuild is-utf8@0.2.0
npm WARN package.json @ No description
npm WARN package.json @ No repository field.
npm WARN package.json @ No README data
is-utf8@0.2.0 node_modules/is-utf8
$ grep homepage node_modules/is-utf8/package.json 
  "homepage": "https://github.com/wayfind/is-utf8"
$ npm rm is-utf8 && npm cache clear is-utf8 && npm i is-utf8
unbuild is-utf8@0.2.0
npm WARN package.json @ No description
npm WARN package.json @ No repository field.
npm WARN package.json @ No README data
is-utf8@0.2.0 node_modules/is-utf8
$ grep homepage node_modules/is-utf8/package.json 
$

Thanks to Jen S. for finding this bug.

@iarna iarna added the bug label Feb 6, 2015
@iarna iarna added this to the multi-stage install milestone Feb 6, 2015
@iarna
Copy link
Contributor

iarna commented Mar 26, 2015

npm@3 solves this by never running normalize-package-data on what's written to your installed version. It does use normalize-package-data but only internally and never writes that to disk.

Closing this as fixed in npm/npm#multi-stage

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants