Skip to content

Skip sha verification when a package is not on npmjs.org #1169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 10, 2015

Conversation

teobugslayer
Copy link
Contributor

Fixes #1147

@teobugslayer teobugslayer added this to the 1.5.0 milestone Nov 10, 2015
@@ -137,13 +137,21 @@ export class NpmInstallationManager implements INpmInstallationManager {
return ((): boolean => {
let shasumProperty = "dist.shasum";
let cachedPackagePath = this.getCachedPackagePath(packageName, version);
let realShasum = this.$npm.view(`${packageName}@${version}`, shasumProperty).wait()[version][shasumProperty];
let packageInfo = this.$npm.view(`${packageName}@${version}`, shasumProperty).wait();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in case the package is not in npm, this code will fail and we'll never get to the next if... or I'm totally missing something.

My test:

$ npm view app12354242
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "view" "app12354242"
npm ERR! node v0.12.7
npm ERR! npm  v2.11.3
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/app12354242
npm ERR! 404
npm ERR! 404 'app12354242' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     d:\Work\nativescript-cli\npm-debug.log

@ns-bot
Copy link

ns-bot commented Nov 10, 2015

Test PASSed.

@teobugslayer
Copy link
Contributor Author

On node 4.2.2 and 0.12 it returns an empty object.

@rosen-vladimirov
Copy link
Contributor

👍

teobugslayer added a commit that referenced this pull request Nov 10, 2015
Skip sha verification when a package is not on npmjs.org
@teobugslayer teobugslayer merged commit 55bdcc2 into master Nov 10, 2015
@teobugslayer teobugslayer deleted the totev/skip-sha-check branch November 10, 2015 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants