Cannot run most nx commands from CLI or from NxConsole
See original GitHub issueCurrent Behavior
Started going through the basic nx tutorial (https://nx.dev/angular/tutorial/01-create-application).
I have been able to launch the app (via ./node_modules/.bin/nx serve todos) from a regular terminal (outside of VSCode), but then I tried to do the same thing with NxConsole in VSCode. I selected the serve
command, specified the “todos” project, changed no defaults, and pressed run. That precipitated this error:
> Executing task: ng serve todos <
Now using node v12.13.1 (npm v6.12.1)
> ng run todos:serve
/Users/msorens/code/sandbox/myorg/node_modules/@nrwl/cli/lib/run-cli.js:13
if (workspace.type === 'nx') {
^
TypeError: Cannot read property 'type' of null
at requireCli (/Users/msorens/code/sandbox/myorg/node_modules/@nrwl/cli/lib/run-cli.js:13:19)
at Object.<anonymous> (/Users/msorens/code/sandbox/myorg/node_modules/@nrwl/cli/lib/run-cli.js:9:1)
at Module._compile (internal/modules/cjs/loader.js:959:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
The terminal process "/usr/local/bin/bash '-l', '-c', '/Users/msorens/code/sandbox/myorg/node_modules/.bin/ng serve todos', 'ng serve todos'" terminated with exit code: 1.
Expected Behavior
Should successfully serve the app with no error. Not a regression; first time I am trying NxConsole.
Steps to Reproduce
Cloned the nx-examples repo; did npm install
, then npm start
outside of VSCode, and it compiled successfully.
Inside VSCode with NxConsole, I selected the serve
command, specified the “products” project, changed no defaults, and pressed run. Here I received a different error:
> Executing task: ng serve products <
Now using node v12.13.1 (npm v6.12.1)
An invalid configuration file was found ['/Users/msorens/code/sandbox/nx-examples/angular.json']. Please delete the file before running the command.
The terminal process "/usr/local/bin/bash '-l', '-c', '/Users/msorens/code/sandbox/nx-examples/node_modules/.bin/ng serve products', 'ng serve products'" terminated with exit code: 1.
I deleted angular.json as specified and then attempted to rerun again, and got this:
> Executing task: ng serve products <
Now using node v12.13.1 (npm v6.12.1)
The serve command requires to be run in an Angular project, but a project definition could not be found.
Failure Logs
NA
Environment
This is running on MacOs 10.14.6
VSCode details: Version: 1.49.1 Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf Date: 2020-09-16T23:21:17.533Z Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 18.7.0
nx report details: @nrwl/angular : 9.5.1 @nrwl/cli : 9.5.1 @nrwl/cypress : 9.5.1 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : 9.5.1 @nrwl/linter : Not Found @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : Not Found @nrwl/tao : 9.5.1 @nrwl/web : Not Found @nrwl/workspace : 9.5.1 typescript : 3.8.3
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
That this issue has been left uncommented for 60+ days by the maintainers of the library screams to newcomers, “DON’T USE NX!”
This issue has been automatically marked as stale because it hasn’t had any recent activity. It will be closed in 14 days if no further activity occurs. If we missed this issue please reply to keep it active. Thanks for being a part of the Nx community! 🙏