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

Update package.json's main prop #1190

Closed

Conversation

kernelwhisperer
Copy link
Contributor

It looks like this package does not work on Node < 10 because of the for...await feature:

 /home/lion/Code/aragon/aragon-cli/packages/aragon-cli/node_modules/ipfs-http-client/src/files-regular/index.js:60
      for await (const entry of get(path, options)) {
          ^^^^^
 SyntaxError: Unexpected reserved word
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Module._compile (/home/lion/Code/aragon/aragon-cli/packages/aragon-cli/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (module.js:663:10)
    at extensions.(anonymous function) (/home/lion/Code/aragon/aragon-cli/packages/aragon-cli/node_modules/require-precompiled/index.js:16:3)
    at newLoader (/home/lion/Code/aragon/aragon-cli/packages/aragon-cli/node_modules/pirates/lib/index.js:104:7)
    at Object.require.extensions.(anonymous function) [as .js] (/home/lion/Code/aragon/aragon-cli/packages/aragon-cli/node_modules/ava/lib/worker/dependency-tracker.js:42:4)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)

I think the issue here is that main points to src instead of dist.

@alanshaw
Copy link
Contributor

alanshaw commented Dec 2, 2019

We don't do any transpilation on the CDN version either. The engines field in the package.json is wrong and we need to update it to the version of Node.js that supports for await, which is 10.3.0.

@0x6431346e would you be up for sending a PR?

@alanshaw alanshaw closed this Dec 2, 2019
@kernelwhisperer
Copy link
Contributor Author

We don't do any transpilation on the CDN version either. The engines field in the package.json is wrong and we need to update it to the version of Node.js that supports for await, which is 10.3.0.

@0x6431346e would you be up for sending a PR?

Fair enough, what's the point of the dist folder and the build script though? (curious)

@kernelwhisperer kernelwhisperer deleted the patch-1 branch December 2, 2019 10:57
@alanshaw
Copy link
Contributor

alanshaw commented Dec 2, 2019

It is for use in the browser with a script tag.

https://github.com/ipfs/js-ipfs#use-in-the-browser

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.

2 participants