stacks-archive / stacks-transactions-js

The JavaScript library for generating Stacks 2.0 transactions
19 stars 17 forks source link

dependency not found installing @blockstack/stacks-transactions #59

Closed dantrevino closed 4 years ago

dantrevino commented 4 years ago

Trying to just add the first example line in the README to a vue app built with webpack. I've removed node_modules and reinstalled everything with both yarn, and then npm. I've removed node_modules then run npm cache verify and yarn cache clean, but no matter what I do I get the dependency not found error.

In my component:

import {
  createStacksPrivateKey,
  makeRandomPrivKey,
  getPublicKey,
} from "@blockstack/stacks-transactions";
const BigNum = require("bn.js");

When building, I get the following:

 ERROR  Failed to compile with 1 errors                                                                    1:14:50 AM

This dependency was not found:

* @blockstack/stacks-transactions in ./node_modules/babel-loader/lib??ref--1-0!./node_modules/@quasar/app/node_module
s/vue-loader/lib??vue-loader-options!./src/pages/Wallet.vue?vue&type=script&lang=js&

To install it, you can run: npm install --save @blockstack/stacks-transactions

Screenshot_20200427_011902

yknl commented 4 years ago

@dantrevino can you check if you're importing the latest alpha version of the transaction lib? if you're not specifying the version, npm will import an old version.

reedrosenbluth commented 4 years ago

Hopefully we'll have this fixed on the stable release later today.

Here's the latest alpha: https://www.npmjs.com/package/@blockstack/stacks-transactions/v/0.3.0-alpha.5

dantrevino commented 4 years ago

Fixed by manually changing the version in package.json to '^0.3.0-alpha.5'. h/t @friedger

Thanks for the update @yknl @reedrosenbluth

yknl commented 4 years ago

We published v0.4.0 to latest on NPM which should resolve this problem.