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

error when npx torchlight init #4

Open
ivanawan opened this issue Sep 3, 2022 · 5 comments
Open

error when npx torchlight init #4

ivanawan opened this issue Sep 3, 2022 · 5 comments

Comments

@ivanawan
Copy link

ivanawan commented Sep 3, 2022

Error: ENOENT: no such file or directory, open '/home/ivan/project/node_modules/@torchlight-api/torchlight-cli/dist/stubs/config.js'

@martydingo
Copy link

For some reason the stubs/config.js file is in src, when using yarn.

when using npm, this file is missing completely.

@pinzonjulian
Copy link

When using Yarn I get the same problem. I found the same as @martydingo , the config file lives in the src folder, not in list where it's expected

@SirNovi
Copy link

SirNovi commented Dec 28, 2022

Stubs folder is also in src when using npm and npx torchlight init is therefore also broken.

@mcgrealife
Copy link

mcgrealife commented Jan 19, 2023

Confirmed. Installed using yarn. npx init is searching for a stubs folder in dist. But thestubs folder is located in src.

Temporary solutions:

  • in node_modules/torchlight-cli , move the stubs folder from src to dist, then run npx torchlight init
  • or simply manually create a torchlight.config.js file in the root of your project directory. The file should simply have a single module.export = {}.
    • The object can be copied from the cli-docs (section: configuration, third code block)

@mavaddat
Copy link

mavaddat commented Feb 23, 2023

Got this too. Solved it by using the following snippet (PowerShell on Windows):

New-Item -Path "$env:APPDATA\npm\node_modules\@torchlight-api\torchlight-cli\dist\stubs\" -Name config.js -ItemType File -Force

In Linux (shell), would be:

mkdir -p $HOME/project/node_modules/@torchlight-api/torchlight-cli/dist/stubs && touch $HOME/project/node_modules/@torchlight-api/torchlight-cli/dist/stubs/config.js

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

No branches or pull requests

6 participants