Custom package.json Properties Removed on Publish #15442

shellscape opened this Issue Jan 10, 2017 · 2 comments


None yet

2 participants

shellscape commented Jan 10, 2017 edited

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • Other (see below for feature requests):

What's going wrong?

I've added a publisher property to package.json to contain publisher metadata during the prepublish process. Npm appears to either be removing the property, or possibly using a cached version of the package data for publishing.

@KenanY pointed out that prepublish now runs after packing (tar'ing). I've also tried prepare and the same holds true for that as well.

How can the CLI team reproduce the problem?

  1. npm init
  2. Add a prepublish script to the package.json, which appends a publisher property to package.json.
  3. npm publish
  4. npm info <module name> or npm install <module name> and inspect result.

supporting information:

  • npm -v prints: 4.1.1
  • node -v prints: 7.3.0
  • npm config get registry prints:
  • Windows, OS X/macOS, or Linux?: MacOS
  • Network issues:
    • Geographic location where npm was run:
    • I use a proxy to connect to the npm registry.
    • I use a proxy to connect to the web.
    • I use a proxy when downloading Git repos.
    • I access the npm registry via a VPN
    • I don't use a proxy, but have limited or unreliable internet access.
  • Container:
    • I develop using Vagrant on Windows.
    • I develop using Vagrant on OS X or Linux.
    • I develop / deploy using Docker.
    • I deploy to a PaaS (Triton, Heroku).
KenanY commented Jan 11, 2017

@shellscape "prepublish" runs after the package has been tarred. So you're adding that property too late.


@KenanY I'll append the OP. same thing happens with prepare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment