Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

fix: don't let qs mangle binary buffers (#569) #570

Merged
merged 1 commit into from
Jun 21, 2017

Conversation

vith
Copy link
Contributor

@vith vith commented Jun 21, 2017

I will be making a PR against interface-ipfs-core to add a test for the scenario that failed without this

@vith
Copy link
Contributor Author

vith commented Jun 21, 2017

CI appears to fail because of an npm@5 bug. webcrypto-shim isn't being installed during npm install. I had the same problem locally.

You can either use npm@4 or delete package-lock.json before running npm install.

I believe it's the same bug as reported here npm/npm#16902

@daviddias
Copy link
Contributor

daviddias commented Jun 21, 2017

Just removed package-lock.json from master. It is still not ready for prime time. Could you rebase master onto your branch for a clean merge?

@daviddias daviddias self-assigned this Jun 21, 2017
@daviddias daviddias merged commit 6cbd89c into ipfs-inactive:master Jun 21, 2017
@atfornes
Copy link
Contributor

atfornes commented Jun 21, 2017

the webcrypto-shim issue is due to the unmet chai dependency that this comment explains.

The output of the command npm list webcrypto-shim shows that the reason is because version discrepancies for chai:

[email protected] /home/antonio/Desarrollo/Projects/js-ipfs-api
├── UNMET PEER DEPENDENCY [email protected]
└─┬ [email protected]
  └─┬ [email protected]
    └── [email protected]  (git://github.com/dignifiedquire/webcrypto-shim.git#effe03d3401ccbfb4837191bc393bb347e0c0f0a)

npm ERR! peer dep missing: chai@<1.10.0 || >1.10.0 <4, required by [email protected]

@atfornes
Copy link
Contributor

the webcrypto-shim issue should be fixed by commit 195b1e5, which updates dirty-chai.

@vith
Copy link
Contributor Author

vith commented Jun 21, 2017

@atfornes I'm not sure they're related. I can still get the same problem just by doing npm install && rm node_modules -rf && npm install even after that commit. The first time it works but creates a package-lock.json; the second time it fails to install webcrypto-shim.

Then karma tests fail as expected with Error: Uncaught Error: Cannot find module "webcrypto-shim" (webpack:///~/libp2p-crypto/src/crypto/webcrypto-browser.js?431a**************:8:0 <- test/repo.spec.js:6639)

@atfornes
Copy link
Contributor

@vith, chai and dirty-chai are development dependencies. Could you try to npm install --dev and let us know if that fixes the issue?

@vith
Copy link
Contributor Author

vith commented Jun 21, 2017

npm installs dev dependencies by default (unless you pass --prod or similar). also:

npm WARN install Usage of the `--dev` option is deprecated. Use `--only=dev` instead.

Here is an isolated way to reproduce what I'm describing:

docker run node:8.1.2 bash -c "git clone https://github.com/ipfs/js-ipfs-api && cd js-ipfs-api && npm install --dev && echo 'first check' && stat ./node_modules/webcrypto-shim && rm node_modules -rf && npm install --dev && echo 'second check' && stat ./node_modules/webcrypto-shim"

In the middle you can see

first check
  File: './node_modules/webcrypto-shim'
  Size: 131       	Blocks: 0          IO Block: 4096   directory
Device: fe01h/65025d	Inode: 8457230     Links: 3
Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2017-06-21 19:47:22.517319430 +0000
Modify: 2017-06-21 19:47:22.575317097 +0000
Change: 2017-06-21 19:47:22.575317097 +0000
 Birth: -

After ~2m22s it will end with

second check
stat: cannot stat './node_modules/webcrypto-shim': No such file or directory

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants