Skip to content
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

Update package.json to fix npm package issue #69 #71

Merged
merged 6 commits into from
Mar 7, 2021
Merged

Update package.json to fix npm package issue #69 #71

merged 6 commits into from
Mar 7, 2021

Conversation

AbhayAysola
Copy link
Contributor

This commit should fix #69
Account Number: 8928526805de48e4bf2ed2a9b4b839e6b2603018ecdfbf4cffdb2065e01a3ed1

@AbhayAysola
Copy link
Contributor Author

@Kycermann @zinoadidi This works fine on my system, but I would like it if you could also test it locally. To do that open up this PR locally and run npm pack in the directory. After that command executes, you should see a thenewboston-1.0.2.tgz file in the directory. After that make a new directory and type npm install <the path of the generated .tgz file> . Once that is done installing simply run node in the newly created dir and try doing require('thenewboston/'). If all goes well it should work :)

@zinoadidi
Copy link
Contributor

hi, i wrote @Kycermann to test as well but anyone can test it and give feedback;
Once i am sure everything now works as expected i will approve PR

@Kycermann
Copy link
Contributor

Kycermann commented Mar 5, 2021

@AbhayAysola I get an error when running npm install <tgz file path> and then running a simple test.js file with the contents:

require("thenewboston")
node:internal/modules/cjs/loader:928
  throw err;
  ^


Error: Cannot find module 'regenerator-runtime/runtime'
Require stack:
- /Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js
- /Users/mieszkokycermann/Desktop/Projects/thenewboston-js/test.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js:101:1)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js',
    '/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/test.js'
  ]
}

node_modules contains axios, core-js, follow-redirects, thenewboston, tweetnacl

My package.json looks like this:

{
  "dependencies": {
    "thenewboston": "file:thenewboston-1.0.2.tgz"
  }
}

@AbhayAysola
Copy link
Contributor Author

@AbhayAysola I get an error when running npm install <tgz file path> and then running a simple test.js file with the contents:

require("thenewboston")
node:internal/modules/cjs/loader:928
  throw err;
  ^


Error: Cannot find module 'regenerator-runtime/runtime'
Require stack:
- /Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js
- /Users/mieszkokycermann/Desktop/Projects/thenewboston-js/test.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:997:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js:101:1)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:973:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:997:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/node_modules/thenewboston/dist/index.js',
    '/Users/mieszkokycermann/Desktop/Projects/thenewboston-js/test.js'
  ]
}

node_modules contains axios, core-js, follow-redirects, thenewboston, tweetnacl

My package.json looks like this:

{
  "dependencies": {
    "thenewboston": "file:thenewboston-1.0.2.tgz"
  }
}

Hmm that is weird, I'll look into it. Thanks for letting me know about this :)

@AbhayAysola
Copy link
Contributor Author

AbhayAysola commented Mar 6, 2021

I'm getting the same error, and its fixed if I install regenerator-runtime . Not sure if that is the best fix though. What do you think? @Kycermann @zinoadidi

@Kycermann
Copy link
Contributor

I'm getting the same error, and its fixed if I install regenerator-runtime . Not sure if that is the best fix though. What do you think? @Kycermann @zinoadidi

If it's a dependency then sure let's do that!

@Kycermann
Copy link
Contributor

I'm still getting errors. Let's jump on a call!

@zinoadidi
Copy link
Contributor

@AbhayAysola @Kycermann
I was doing a little looking around and found that the package
require("regenerator-runtime/runtime.js"); was in dist index js file.
It seems babel is using it for something i am not sure entirely what
but try the suggestions here https://stackoverflow.com/questions/55857804/cannot-find-module-regenerator-runtime-runtime
someone mentioned that installing @babel/polyfill fixed the issue for them and a whole lot of other options;
but try and see what comes

@Kycermann
Copy link
Contributor

@AbhayAysola I tried with your latest branch, I get a completely different error. We should really go over this with screen share etc would be faster.

@Kycermann
Copy link
Contributor

Ah @zinoadidi ofc it's a typescript issue lol
I'll look tomorrow

@AbhayAysola
Copy link
Contributor Author

@Kycermann @zinoadidi I think it should work now.

@AbhayAysola
Copy link
Contributor Author

@zinoadidi I'm pretty sure that @babel/polyfill is deprecated in favor of core-js and regenerator-runtime. - https://babeljs.io/docs/en/babel-polyfill . I did try uninstalling regenerator-runtime and installing @babel/polyfill and it still works. I also tried @babel/runtime instead of regenerator-runtime and it worked.

@Kycermann
Copy link
Contributor

It works IT WORKS @zinoadidi merge this ASAP please. @AbhayAysola don't forget to increment the version number!!

@zinoadidi
Copy link
Contributor

@AbhayAysola @Kycermann good job guys;
Version update will be done once per merge to master to better manage the deployment process.
you don't need to do it in the PR

@zinoadidi zinoadidi closed this Mar 7, 2021
@zinoadidi zinoadidi reopened this Mar 7, 2021
@zinoadidi zinoadidi merged commit 5a18662 into thenewboston-blockchain:development Mar 7, 2021
@AbhayAysola AbhayAysola deleted the development branch March 7, 2021 12:52
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