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 v 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 withingit
andnpm
. 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 withingit
. 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
nodebb-plugin-expiring-uploads
Redirects uploads to a non-public location and exposes them via an expiring token.. Latest version: 0.2.2, last published: 9 years ago. Start using nodebb-plugin-expiring-uploads in your project by running `npm i nodebb-plugin-expiring-uploads`. There are no other projects in the npm registry using nodebb-plugin-expiring-uploads.
npm (www.npmjs.com)
github one
GitHub - rbeer/nodebb-plugin-expiring-uploads: Plugin for NodeBB, hiding uploads behind an expiring hash
Plugin for NodeBB, hiding uploads behind an expiring hash - rbeer/nodebb-plugin-expiring-uploads
GitHub (github.com)
looking to modify the default markup when the upload is complete.
nodebb-plugin-expiring-uploads/public/scripts/controller.js at master · rbeer/nodebb-plugin-expiring-uploads
Plugin for NodeBB, hiding uploads behind an expiring hash - nodebb-plugin-expiring-uploads/public/scripts/controller.js at master · rbeer/nodebb-plugin-expiring-uploads
GitHub (github.com)
bascially this.