Error: ENOENT: no such file or directory, open '~/tools/tsconfig.tools.json'
See original GitHub issueCustom generator fails with following error:
Current Behavior
> npx nx workspace-generator new-package some
nx workspace-generator [name]
Runs a workspace generator from the tools/generators directory
Positionals:
name The name of your generator [string] [required]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--list-generators List the available workspace-generators [boolean]
Find more information and examples at https://nx.dev/cli/workspace-generator
Error: ENOENT: no such file or directory, open '/workspace/reatom/tools/tsconfig.tools.json'
at Object.openSync (node:fs:585:3)
at readFileSync (node:fs:453:35)
at readJsonFile (/workspace/reatom/node_modules/nx/src/utils/fileutils.js:21:43)
at toolsTsConfig (/workspace/reatom/node_modules/nx/src/command-line/workspace-generators.js:93:41)
at getToolsOutDir (/workspace/reatom/node_modules/nx/src/command-line/workspace-generators.js:49:20)
at compileTools (/workspace/reatom/node_modules/nx/src/command-line/workspace-generators.js:40:25)
at Object.<anonymous> (/workspace/reatom/node_modules/nx/src/command-line/workspace-generators.js:26:24)
at Generator.next (<anonymous>)
at /workspace/reatom/node_modules/tslib/tslib.js:118:75
at new Promise (<anonymous>) {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: '/workspace/reatom/tools/tsconfig.tools.json'
}
Expected Behavior
A new folder and files generated.
Steps to Reproduce
- Go to the repo: https://github.com/artalar/reatom/tree/233ac496bb20bd0973479547142109a0453bda3d
- Clone it or open by gitpod.io
npm i
npx nx workspace-generator new-package some
Failure Logs
Environment
Personal MacBook Air:
Node : 16.13.1
OS : darwin arm64
npm : 8.1.2
nx : 14.1.9
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.9
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 14.1.9
@nrwl/js : Not Found
@nrwl/linter : 14.1.9
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 14.1.9
typescript : 4.6.4
---------------------------------------
Community plugins:
@ngrx/store: 13.2.0
Gitpod instance:
Node : 16.15.0
OS : linux x64
npm : 8.5.5
nx : 14.1.9
@nrwl/angular : Not Found
@nrwl/cypress : Not Found
@nrwl/detox : Not Found
@nrwl/devkit : 14.1.9
@nrwl/eslint-plugin-nx : Not Found
@nrwl/express : Not Found
@nrwl/jest : 14.1.9
@nrwl/js : Not Found
@nrwl/linter : 14.1.9
@nrwl/nest : Not Found
@nrwl/next : Not Found
@nrwl/node : Not Found
@nrwl/nx-cloud : Not Found
@nrwl/nx-plugin : Not Found
@nrwl/react : Not Found
@nrwl/react-native : Not Found
@nrwl/schematics : Not Found
@nrwl/storybook : Not Found
@nrwl/web : Not Found
@nrwl/workspace : 14.1.9
typescript : 4.6.4
---------------------------------------
Community plugins:
@ngrx/store: 13.2.0
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:8 (2 by maintainers)
Top Results From Across the Web
no such file or directory in tsconfig.app.json using angular 4?
Show activity on this post. Check the path for the tsconfig property in the angular. json file. Correcting that path should fix this...
Read more >Project Configuration
json files are located in each project's folder. Nx merges the two files to get each project's configuration. The following configuration creates build...
Read more >no such file or directory, open \package.json install bootstrap ...
✓ Solved: npm WARN saveError ENOENT : no such file or directory, open \package. json install bootstrap.
Read more >nrwl-nx/community - Gitter
Hi Guys, I am a newbie to cypress and nrwl nx style. I wanted to set my env variable defined in the cypress.json...
Read more >Parsing Error: Cannot read file 'tsconfig.json'
Another cause of the "Parsing Error: Cannot read file 'tsconfig.json'" is when we open our code editor in a different directory than the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dan-cooke Oh now I understand where I got confused, sorry. I’m creating a generator to create a new package and somehow I thought this
tsconfig
was the one copied to the new package (which doesn’t make sense now that I think about it). So now that I used the exact same config used in the example repo, it worked! Thanks for helping out 🙏I removed the
extends
property so I ended up with the following config:tools/tsconfig.tools.json
This
tsconfig.tools.json
should definitely be added when runningnx generate @nrwl/workspace:workspace-generator my-generator
to avoid confusion.I’m trying to fix it, what does that even mean???