nx.dev 创建第一个应用程序失败并找不到模块

Dea*_*ler 7 npm yarnpkg nx.dev

在尝试 nx.dev 时,我运行了这个命令

npx nx generate @nrwl/node:app ghApi
Run Code Online (Sandbox Code Playgroud)

并收到此错误

Unable to resolve @nrwl/node:app.
Cannot find module '@nrwl/node/package.json'
Require stack:
- /Users/dean/workspace/gazehealth/nxdev-workspace/node_modules/nx/src/utils/nx-plugin.js
- /Users/dean/workspace/gazehealth/nxdev- workspace/node_modules/nx/src/config/workspaces.js
- /Users/dean/workspace/gazehealth/nxdev-workspace/node_modules/nx/src/command- line/generate.js
- /Users/dean/workspace/gazehealth/nxdev-workspace/node_modules/nx/src/command-line/nx-commands.js
- /Users/dean/workspace/gazehealth/nxdev-workspace/node_modules/nx/bin/init-local.js
- /Users/dean/workspace/gazehealth/nxdev-workspace/node_modules/nx/bin/nx.js
Run Code Online (Sandbox Code Playgroud)

我只是按照https://nx.dev/getting-started/nx-and-typescript的说明进行操作 ,有什么想法吗?

Yur*_*kiv 26

我有类似的问题。

尝试:nx report

你会看到这样的东西:

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.0
   OS   : darwin x64
   npm  : 8.5.5
   
   nx : 14.2.2
   @nrwl/angular : 14.2.2
   @nrwl/cypress : 14.2.2
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.2.2
   @nrwl/eslint-plugin-nx : Not Found
   @nrwl/express : Not Found
   @nrwl/jest : 14.2.2
   @nrwl/js : Not Found
   @nrwl/linter : 14.2.2
   @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 : 14.2.2
   @nrwl/web : Not Found
   @nrwl/workspace : 14.2.2
   typescript : 4.7.3
Run Code Online (Sandbox Code Playgroud)

就我而言,@nrwl/node“未找到”

所以我只是安装了它:npm i @nrwl/node

之后,就nx g @nrwl/node:app MyAppName成功了。

我希望这能有所帮助!