what causes npm install different than git clone

  • when i do npm install of a plugin, its diferent code base than git clone of the repo, same version in package.json as the git repo.

  • @chrismccoy which plugin are you trying to install?

    same version in package.json doesn't mean code will be the same... there might be more check-in's after it's published to npm and usually version on github in package.json is not changed until it's ready to be published to npm again.

  • The mantainer could have just published to npm and evolved the code in the repo without updating the version according to a new release. If he/she makes the change of version in package.json just before publishing to npm, you can have the fepo with and 'old' version and new code while evolving to the next 'npm release'.

  • In general git is a tool for versioning source code.
    npm instead is a package manager, so it's targeting the production code.

    Basically you have this workflow

    git v0.1.0 -----> compilation -----> npm v0.1.0
         | code changes
    git v0.1.1 -----> compilation -----> npm v0.1.1

    For any kind of software; You don't publish binaries/production code within git. Only if the source code equals the production code (thus there is no compilation step involved) you'll have the same within git and npm. But this in fact is the special case (which is quite common for purely javascript projects).
    It gets worse if people publish their binaries/production code alongside their source code within git. This has been quite popular for javascript projects (with minified production files) in the past because no package management was popular for javascript.

    As a rule of thumb: git (ore more general VCS) is for publishing source code; package manager are for publishing production files.

  • the expiring downloads plugin.

    on the npm install one, only a few js files are present.

    here is npm v0.2.2

    github one


    looking to modify the default markup when the upload is complete.


    bascially this.

Suggested Topics

| | | |