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

only-allow: not found / MODULE_NOT_FOUND #9078

Closed
PeterBenc opened this issue Jan 18, 2024 · 9 comments · Fixed by #9805
Closed

only-allow: not found / MODULE_NOT_FOUND #9078

PeterBenc opened this issue Jan 18, 2024 · 9 comments · Fixed by #9805
Labels
A-pkg-sdk Area: packages/sdk C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed

Comments

@PeterBenc
Copy link

Opening the issue, not because I am convinced that the source of the problem is here, but just to let you guys know that there is such issue, and possible fix.

Describe the bug

  • we are using optimism-sdk as dependency
  • locally, all seem to work
  • on circleCI or on heroku, the yarn install command (seemingly randomly) fails with
Exit code: 127
Command: npx only-allow pnpm
Arguments: 
Directory: /home/circleci/repo/node_modules/@eth-optimism/core-utils
Output:
npm WARN exec The following package was not found and will be installed: [email protected]
sh: 1: only-allow: not found
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Exited with code exit status 127

or

error /home/circleci/repo/node_modules/@eth-optimism/contracts-bedrock: Command failed.
Exit code: 1
Command: npx only-allow pnpm
Arguments: 
Directory: /home/circleci/repo/node_modules/@eth-optimism/contracts-bedrock
Output:
npm WARN exec The following package was not found and will be installed: [email protected]
node:internal/modules/cjs/loader:1080
  throw err;
  ^

Error: Cannot find module '/home/circleci/.npm/_npx/0b83cd9ca5e1325c/node_modules/.bin/only-allow'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
    at Module._load (node:internal/modules/cjs/loader:922:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v18.17.1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

To Reproduce

  • hard to do, for us, the yarn install script was failing randomly, we haven't figured out what is it dependent on

Expected behavior

  • yarn install works, only allow gets installed and is found

System Specs:
"@eth-optimism/sdk": "^3.1.6"

Additional context
Possibly related
pnpm/only-allow#11
npm/cli#2660
Lightprotocol/light-protocol#381
juliencrn/usehooks-ts#420

Possible fix

  • we added only-allow package as devDependency which seemed to fix the issue.
@roninjin10
Copy link
Contributor

@PeterBenc are you able to share a reproducible example? Link to the repo this is happening in or a minimal reproducible example?

@PeterBenc
Copy link
Author

@roninjin10 sorry, no, I haven't been able to reproduce it, it just kept happening randomly in circleCI or in heroku. Its a private repo so cannot share more.
Just posting the issue here, so you guys (and other in future) are aware that this happens.

@roninjin10
Copy link
Contributor

@roninjin10 sorry, no, I haven't been able to reproduce it, it just kept happening randomly in circleCI or in heroku. Its a private repo so cannot share more. Just posting the issue here, so you guys (and other in future) are aware that this happens.

By randomly do you mean it sometimes would not happen sometimes would happen? Are you able to share the install command that this is failing on and/or more of the logging context this error happened on? Are you just running yarn install or something else?

@roninjin10
Copy link
Contributor

What version of npm are you using?

@smartcontracts smartcontracts added C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed A-pkg-sdk Area: packages/sdk labels Feb 5, 2024
@acgith
Copy link

acgith commented Feb 16, 2024

We are having the same issue in ci when doing npm ci. It fails randomly >50% of the time.

@alecananian
Copy link
Contributor

alecananian commented Mar 9, 2024

Same here, fails on Vercel. The only-allow script likely shouldn't be added to these packages that can be installed by arbitrary consumers using npm, yarn, etc.

@roninjin10
Copy link
Contributor

I will approve a pr opened that removes it. preinstall scripts aren’t supposed to ever run for npm packages so it’s odd that it’s causing issues

@joaquim-verges
Copy link

@roninjin10 thanks for merging #9805 !

we just recently added the dependency to the @thirdweb-dev/sdk package which is causing issues with yarn/npm for our users (this is what prompted @alecananian PR)

Any chance we can get #9812 merged today to get the latest release?

@0xfrosty
Copy link

Hey @roninjin10 , do you have an ETA for releasing this merge? Our pipelines fail most of the time because of this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-pkg-sdk Area: packages/sdk C-bug Category: bugs S-unconfirmed Status: Issue might be valid, but it’s not yet confirmed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants