nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
22.93k stars 2.29k forks source link

Unable to run a build after migrating from v15 #20873

Closed chrisolsen closed 8 months ago

chrisolsen commented 8 months ago

Current Behavior

When trying to run a build command I see the following

Unable to resolve @nx/run-commands:undefined.

Expected Behavior

Library is built successfully

GitHub Repo

https://github.com/chrisolsen/ui-components/pull/new/1450-upgrade-to-svelte4

Steps to Reproduce

npm run build react-components --withDeps --configuration production

Results in Unable to resolve @nx/run-commands:undefined.

Nx Report

➜  ui-components git:(1450-upgrade-to-svelte4) ✗ nx report           
>  NX  Falling back to ts-node for local typescript execution. This may be a little slower.
  - To fix this, ensure @swc-node/register and @swc/core have been installed

 >  NX   Report complete - copy this into the issue template

   Node   : 18.18.2
   OS     : linux-x64
   npm    : 9.8.1

   nx (global)        : 17.2.6
   nx                 : 17.2.6
   @nx/js             : 17.2.6
   @nx/jest           : 17.2.6
   @nx/linter         : 17.2.6
   @nx/eslint         : 17.2.6
   @nx/workspace      : 17.2.6
   @nx/devkit         : 17.2.6
   @nrwl/devkit       : 11.5.2
   @nx/eslint-plugin  : 17.2.6
   @nx/node           : 17.2.6
   @nx/react          : 17.2.6
   @nrwl/tao          : 11.5.2
   @nx/vite           : 17.2.6
   @nx/web            : 17.2.6
   typescript         : 5.2.2
   ---------------------------------------
   Community plugins:
   @abgov/nx-release  : 1.1.4
   @compodoc/compodoc : 1.1.23
   ---------------------------------------
   The following packages should match the installed version of nx
     - @nrwl/devkit@11.5.2
     - @nrwl/tao@11.5.2

   To fix this, run `nx migrate nx@17.2.6`

Failure Logs

➜  ui-components git:(1450-upgrade-to-svelte4) ✗ npm run build react-components --withDeps --configuration production --verbose
npm verb cli /home/chris/.nvm/versions/node/v18.18.2/bin/node /home/chris/.nvm/versions/node/v18.18.2/bin/npm
npm info using npm@9.8.1
npm info using node@v18.18.2
npm verb title npm run build react-components production
npm verb argv "run" "build" "react-components" "--withDeps" "--configuration" "production" "--loglevel" "verbose"
npm verb logfile logs-max:10 dir:/home/chris/.npm/_logs/2023-12-20T22_12_21_431Z-
npm verb logfile /home/chris/.npm/_logs/2023-12-20T22_12_21_431Z-debug-0.log

> abgov@0.0.0 build
> nx build react-components production

 >  NX   Unable to resolve @nx/run-commands:undefined.

   Cannot find module '@nx/run-commands/package.json'
   Require stack:
   - /home/chris/Code/Work/ui-components/node_modules/nx/src/utils/package-json.js
   - /home/chris/Code/Work/ui-components/node_modules/nx/src/utils/package-manager.js
   - /home/chris/Code/Work/ui-components/node_modules/nx/bin/init-local.js
   - /home/chris/Code/Work/ui-components/node_modules/nx/bin/nx.js
   Pass --verbose to see the stacktrace.

npm verb exit 1
npm verb code 1

Package Manager Version

No response

Operating System

Additional Information

No response

AgentEnder commented 8 months ago

It seems like a migration went wrong somewhere. I'd recommend searching and replacing @nx/run-commands with nx:run-commands

github-actions[bot] commented 7 months ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.