How can I update the protractor npm module in node.js?
node.js, protractor, visual-studio
Solution
The "npm update" command doesn't actually upgrade packages unconditionally. It simply upgrades packages to the maximum allowed semver as noted in the package.json file for your dependencies and their sub dependencies. To actually upgrade to a newer version you have two options:
Use "npm install" and specify the version to install. You can use the "latest" tag to specify the latest version without having to look it up. Use the "--save" flag to have npm edit your package.json file and update to the new version.
npm install protractor@latest --save
Edit the package.json and find the line with "protractor": "0.24.2" and change the version to "1.0.0-rc2" (or whichever version you want). Then you can run "npm update" or "npm install" after you have changed and saved the file.
Problem
I am using Visual Studio 2013 Node.js Tools for Visual Studio. I would like to update protractor to this: ``` https://www.npmjs.org/package/protractor ``` Under npm in Visual Studio I see it shows I have the protractor@0.24.2 module. When I right click on this and select ``` update npm module ``` It goes to ``` https://registry.npmjs.org/protractor ``` When I enter that in my URL it shows on the the first line `1.0.0-rc2` as the latest version: ``` https://registry.npmjs.org/protractor {"_id":"protractor","_rev":"103-dc957e08fce862ad70c481b4a2327ee6", "name":"protractor","description":"Webdriver E2E test wrapper for Angular.", "dist-tags":{"latest":"1.0.0-rc2"}, "versions":{"0.1.0":{"name":"protractor", "description":"End to End test helpers for Angular.", "homepage":"https://github.com/juliemr/protractor","keywords": ``` In the output window it shows the update: ``` ====Executing command 'npm update protractor --save'==== npm http GET https://registry.npmjs.org/protractor npm http 304 https://registry.npmjs.org/protractor npm http GET https://registry.npmjs.org/selenium-webdriver npm http GET https://registry.npmjs.org/jasminewd npm http GET https://registry.npmjs.org/glob npm http GET https://registry.npmjs.org/saucelabs npm http GET https://registry.npmjs.org/adm-zip npm http GET https://registry.npmjs.org/optimist npm http GET https://registry.npmjs.org/lodash npm http GET https://registry.npmjs.org/q npm http GET https://registry.npmjs.org/source-map-support npm http 304 https://registry.npmjs.org/selenium-webdriver npm http 304 https://registry.npmjs.org/jasminewd npm http 304 https://registry.npmjs.org/saucelabs npm http 304 https://registry.npmjs.org/optimist npm http 304 https://registry.npmjs.org/q npm http 304 https://registry.npmjs.org/glob npm http 304 https://registry.npmjs.org/adm-zip npm http 304 https://registry.npmjs.org/lodash npm http 304 https://registry.npmjs.org/source-map-support npm http GET https://registry.npmjs.org/inherits npm http GET https://registry.npmjs.org/minimatch npm http GET https://registry.npmjs.org/wordwrap npm http GET https://registry.npmjs.org/minimist npm http GET https://registry.npmjs.org/source-map npm http 304 https://registry.npmjs.org/inherits npm http 304 https://registry.npmjs.org/minimatch npm http 304 https://registry.npmjs.org/wordwrap npm http 304 https://registry.npmjs.org/minimist npm http 304 https://registry.npmjs.org/source-map npm http GET https://registry.npmjs.org/lru-cache npm http GET https://registry.npmjs.org/sigmund npm http 304 https://registry.npmjs.org/lru-cache npm http 304 https://registry.npmjs.org/sigmund npm http GET https://registry.npmjs.org/amdefine npm http 304 https://registry.npmjs.org/amdefine protractor@0.24.2 node_modules\protractor ├── jasminewd@1.0.1 ├── saucelabs@0.1.1 ├── q@1.0.0 ├── adm-zip@0.4.4 ├── optimist@0.6.1 (wordwrap@0.0.2, minimist@0.0.10) ├── lodash@2.4.1 ├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0) ├── source-map-support@0.2.7 (source-map@0.1.32) └── selenium-webdriver@2.42.0 ====npm command completed with exit code 0==== ``` What I would like to know is if the first line shows `1.0.0-rc2` as the latest version then why does it still show protractor 0.24.2 as the one that it downloaded after the update?