hatertron3000 / big-widget

A tool for building BigCommerce Page Builder widget templates
25 stars 10 forks source link

Receive the following message when trying to initialize big-widget #10

Open vishwa742 opened 3 years ago

vishwa742 commented 3 years ago

Error

I created a config.big-widget.json file and populated it with the response from creating the widget using the request runner

I was hoping you could tell me where I'm going wrong. Thanks

Error: Initializing the project... Error during initializationn [Error: ENOENT: no such file or directory, open 'C:\Users\vichu\OneDrive\Desktop\Widgets\secrets.C:\Program Files\nodejs\node_modules\big-widget\bin\big-widget.json'] { errno: -4058, code: 'ENOENT', syscall: 'open', path: 'C:\\Users\\vichu\\OneDrive\\Desktop\\Widgets\\secrets.C:\\Program ' + 'Files\\nodejs\\node_modules\\big-widget\\bin\\big-widget.json' }

jasonmitchell42 commented 3 years ago

Also having this same issue. Keen to know how to fix it.

Steps:

  1. Installed big-widget globally (npm i -g big-widget)
  2. created directory for new widget (empty)
  3. ran big-widget init and entered information
  4. Received the error as shown in the screenshot above.
keobrien commented 3 years ago

+1, same issue when installed globally and when installed in the project dependencies and using npx to execute it. In src/init.js the code argv.$0 is using the path to the bin script, not the script name.

A quick workaround, until this is solved, is to make a symlink in the current directory:

ln -s ./node_modules/.bin/big-widget big-widget

Then call init through that:

./big-widget init
hatertron3000 commented 3 years ago

Thanks for reporting this, @vishwa742 and apologies that I haven't had the bandwidth to address it yet. I suspect this has something to do with developing in a Windows environment vs. a Unix-based environment, but I haven't had a chance to validate that yet. I'll follow up once I am able to test on a Windows machine.

In the meantime, I wanted to make sure that you're aware that BigCommerce released an official Widget Builder tool. It is documented here and, honestly, is a bit nicer than big-widget: https://developer.bigcommerce.com/api-docs/storefront/widgets/widget-builder

marcinkrzeminski commented 2 years ago

@hatertron3000 FYI I'm having similar issue on MBP M1 Max

keobrien commented 2 years ago

@hatertron3000 I am also able to reproduce this on my MacBook Pro 2017 MacOS 11.6 (not M1 chip)

marcinkrzeminski commented 2 years ago

@hatertron3000 here's the output:

Error during initializationn
 [Error: ENOENT: no such file or directory, open 'config.node_modules/.bin/big-widget.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: 'config.node_modules/.bin/big-widget.json'
}