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

Error when running truffle unbox optimism #21

Open
ghost opened this issue May 23, 2022 · 5 comments
Open

Error when running truffle unbox optimism #21

ghost opened this issue May 23, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented May 23, 2022

Hi, could you please point out if this is my misunderstanding or if something is causing this issue on your side?

Attaching the error message.

$ truffle unbox optimism
This directory is non-empty...
? Proceed anyway? (Y/n) 
Starting unbox...
=================

? Proceed anyway? Yes
✓ Preparing to download box
✓ Downloading
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "from" argument must be of type string. Received undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eli/.npm/_logs/2022-05-23T20_37_05_269Z-debug-0.log
✓ Cleaning up temporary files
✖ Setting up box
Unbox failed!
Error: Command failed: npm install --loglevel=error && touch .env
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "from" argument must be of type string. Received undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eli/.npm/_logs/2022-05-23T20_37_05_269Z-debug-0.log

    at checkExecSyncError (node:child_process:828:11)
    at Object.execSync (node:child_process:899:15)
    at Object.installBoxDependencies (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:139:1)
    at Object.setUpBox (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/index.js:52:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/box.js:183:1
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/box.js:5:43)
Truffle v5.5.15 (core: 5.5.15)
Node v16.15.0

@fainashalts
Copy link
Contributor

Hi @timofeli thanks for reaching out! I see in your output that you are unboxing into a non-empty directory. When I attempt the command in an empty directory everything appears to work as expected. Can you try this in an empty directory and let me know if it works? Thanks!

@ghost
Copy link
Author

ghost commented May 24, 2022

@fainashalts Thank you for your prompt reply!
I just did it and had the same error.

eli@eli-XPS-13-9360:~/test2$  truffle unbox optimism

Starting unbox...
=================

✓ Preparing to download box
✓ Downloading
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "from" argument must be of type string. Received undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eli/.npm/_logs/2022-05-24T06_30_31_985Z-debug-0.log
✓ Cleaning up temporary files
✖ Setting up box
Unbox failed!
Error: Command failed: npm install --loglevel=error && touch .env
npm ERR! code ERR_INVALID_ARG_TYPE
npm ERR! The "from" argument must be of type string. Received undefined

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eli/.npm/_logs/2022-05-24T06_30_31_985Z-debug-0.log

    at checkExecSyncError (node:child_process:828:11)
    at Object.execSync (node:child_process:899:15)
    at Object.installBoxDependencies (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/unbox.js:139:1)
    at Object.setUpBox (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/lib/utils/index.js:52:1)
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/box.js:183:1
    at Generator.next (<anonymous>)
    at fulfilled (/usr/local/lib/node_modules/truffle/build/webpack:/packages/box/dist/box.js:5:43)
Truffle v5.5.15 (core: 5.5.15)
Node v16.15.0

@beakerfm
Copy link
Contributor

Seems to be an issue with the version of node and changes between major versions. I received same error as @timofeli when using node v17.4.0. Seems they are using 16.15.0 when testing above. When downgrading to a lower version of node 12.22.12 the unbox worked successfully. I removed the node_modules directory from this repo to allow the post install script to execute and it seems to work as intended. Here is open PR with the change to fix this issue: #25

@beakerfm
Copy link
Contributor

@timofeli your issue should now be resolved as #26 is merged with the fix.

@fainashalts
Copy link
Contributor

Hello @timofeli so sorry I lost track of this. Looks like @beakerfm was able to help get this resolved. I'm going to close this issue but please feel free to open a fresh one if you encounter any other issues! Thanks!

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

No branches or pull requests

2 participants