How to install prebid and build
I need to be able to track timeouts by bidder. I used to use GA tacking to do that, but it is no longer available in the direct download, unless I compile my own prebid.js I have never used node.js and gulp. Questions:
- Are there step-by step instructions on how to set up and use node.js and gulp?
- Is there another way to use GA (or other anaylytics) without having to learn node.js and gulp?
brew install node && npm i -g gulp on Mac
then just use the build commands on Github.
@headerbidding did the above work for you?
I don't know what "brew install node && npm install gulp" is and I do not have a Mac. I use Windows 7.
- download and run the node installer for windows: https://nodejs.org/en/download/
- Download and run the git installer: https://git-scm.com/download/win
- Open a terminal window and run
npm install -g gulp - Checkout the project using git. Open a terminal and run
git clone https://github.com/prebid/Prebid.js.git - Move into the directory of
${local_path}/Prebid.jscreated by git clone and runnpm installand thengulp build - Built prebid will reside in
${local_path}/Prebid.js/build/dist/prebid.js
1-2-3-4 worked perfectly. When I did 5 npm install I got error messages:
C:\Users>npm install -g gulp npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail o n node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible . Use 'npm ls graceful-fs' to find it in the tree.
It looks like you have an older version of node installed.
npm ERR! node v4.5.0
You should have a 6.x.x version. See here to update: http://stackoverflow.com/questions/18412129/how-do-i-update-node-and-npm-on-windows
The instructions were too complex. I went ahead and just installed from your link https://nodejs.org/en/download/ and I now have version 6
STEP 3:
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\windows\system32>npm install -g gulp
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher
to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail o
n node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible
. Use 'npm ls graceful-fs' to find it in the tree.
C:\Users\Hubert\AppData\Roaming\npm\gulp -> C:\Users\Hubert\AppData\Roaming\npm
node_modules\gulp\bin\gulp.js
C:\Users\Hubert\AppData\Roaming\npm
`-- [email protected]
C:\windows\system32>
STEP 4: C:\Users\Hubert>git clone https://github.com/prebid/Prebid.js.git Cloning into 'Prebid.js'... remote: Counting objects: 4173, done. remote: Compressing objects: 100% (45/45), done. remote: Total 4173 (delta 19), reused 0 (delta 0), pack-reused 4127 eceiving obj Receiving objects: 100% (4173/4173), 1.67 MiB | 1.14 MiB/s, done.
Resolving deltas: 100% (2710/2710), done.
C:\Users\Hubert>
Step 5: also worked, with just a few warnings
Wow! I assume I now have a prebid.js with all the adapters! Cool! Now I have to figure out how to make one with selected adapters only ...
Hmm. the prebid.js file generated is only 30kb. When I donload it from http://prebid.org/download.html with the selected adapters it is 50kb.
Modify Prebid.js/adapters.json to list only the adapters you want to be built with and then run gulp build
Wow. It worked! I made my own 0.15.3-pre version !!!
But: I still get the Error: Object {} "ERROR: Prebid Error: no analytics adapter found in registry for ga." ""
I figured it out: I forgot to include "ga" in the "analytics" array in package.json.
So I changed "analytics": [], to "analytics": "ga", but got an error when doing another gulp build:
An array is expected, try "analytics": ["ga"]
Thank you! It works now! Thanks to all for your help!
@headerbidding Glad it's working.
@prebid/docs this ticket could be used as a starting point for more verbose dev help docs / getting starting with dev
Yes. Your instructions were great. I have never used npm or git and it was easy to follow!
@prebid/docs Adding screenshots of the CMD and GIT windows would make it even more foolproof.