nrwl / nx

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

Error: Cannot find module '@nrwl/workspace/src/utils/perf-logging' #4656

Closed udayvunnam closed 3 years ago

udayvunnam commented 3 years ago

I have tried to migrate to the latest nx version but getting error as Cannot find module '@nrwl/workspace/src/utils/perf-logging'

It seems that @nrwl/workspace/src/utils/perf-logging is required at https://github.com/nrwl/nx/blob/d8fafcd00fd2608272d466f4a9ed216ea7995b30/packages/cli/lib/init-local.ts#L14

When we actually look at https://github.com/nrwl/nx/tree/master/packages/workspace/src/utils there is no such file perf-logging.ts

Can you please check

"@nrwl/workspace": "11.2.6", "@nrwl/angular": "11.2.6",

iztokb commented 3 years ago

Yup, same issue here. "@nrwl/workspace": "11.2.6" ""@nrwl/angular": "11.2.6"

mandarini commented 3 years ago

Hello there @udayvunnam and @iztokb ! Can you please try changing @nrwl/workspace/src/utils/perf-logging to @nrwl/workspace/src/utilities/perf-logging and let me know if this fixes your issue?

vsavkin commented 3 years ago

@udayvunnam thank you for submitting the issue. Could you provide a repo with a repro?

I think your @nrwl/cli might be out of sync with the rest of the packages.

udayvunnam commented 3 years ago

@vsavkin below are the details

git clone https://github.com/udayvunnam/xng-breadcrumb.git
git checkout feat/nx-upgrade
yarn install
yarn start

_yarn start_ gives the error

Error: Cannot find module '@nrwl/workspace/src/utils/perf-logging' Require stack:

Reference PR - https://github.com/udayvunnam/xng-breadcrumb/pull/73

udayvunnam commented 3 years ago

I tried to upgrade via nx migrate latest

mandarini commented 3 years ago

I cloned your repo, and I observed that your version of @nrwl/cli is indeed out of sync with the rest of the packages "@nrwl/cli": "10.3.0".

So, you can try running yarn add -D @nrwl/cli and then you will be able to start your server.

udayvunnam commented 3 years ago

Thank you @mandarini. That works!

Shouldn't nx migrate latest upgrade @nrwl/cli version too?

udayvunnam commented 3 years ago

@vsavkin @mandarini Thanks a ton for building nx. My work and personal projects have been much productive with it.

mandarini commented 3 years ago

Thank you @udayvunnam for the kind words! :)

kevinbeal commented 3 years ago

Shouldn't nx migrate latest upgrade @nrwl/cli version too?

It did for me when I tried it just now.

val-samonte commented 3 years ago

just commenting to confirm that this happens to me as well. for anyone who will encounter this in the future, just check the @nrwl/cli inside package.json and make sure it has the same version as the rest of @nrwl packages

Sikora00 commented 3 years ago

For me too. @nrwl/cli was not upgraded with the rest of the packages.

andyjessop commented 2 years ago

For me too, but changing it manually gives more errors:

npm ERR! While resolving: web@0.0.0
npm ERR! Found: @nrwl/eslint-plugin-nx@13.9.5
npm ERR! node_modules/@nrwl/eslint-plugin-nx
npm ERR!   dev @nrwl/eslint-plugin-nx@"14.1.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! dev @nrwl/eslint-plugin-nx@"14.1.7" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @typescript-eslint/parser@5.18.0
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   peer @typescript-eslint/parser@"~5.18.0" from @nrwl/eslint-plugin-nx@14.1.7
npm ERR!   node_modules/@nrwl/eslint-plugin-nx
npm ERR!     dev @nrwl/eslint-plugin-nx@"14.1.7" from the root project
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/andy/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/andy/.npm/_logs/2022-05-19T14_44_00_661Z-debug.log
nhhockeyplayer commented 2 years ago

My migrations went fine cli updated to latest

This is causing all my projects to fail any build commands. No solution as of yet.

meanstack02@admin starter % nx build shared-sass

> nx run shared-sass:build:production

Cannot find module 'nx/src/utils/app-root'
Require stack:
- /Users/meanstack02/new/starter/node_modules/@nrwl/devkit/index.js
- /Users/meanstack02/new/starter/node_modules/@nrwl/angular/src/executors/package/package.impl.js
- /Users/meanstack02/new/starter/node_modules/@nrwl/workspace/node_modules/nx/src/config/workspaces.js
- /Users/meanstack02/new/starter/node_modules/@nrwl/workspace/node_modules/nx/src/command-line/run.js
- /Users/meanstack02/new/starter/node_modules/@nrwl/workspace/node_modules/nx/bin/run-executor.js

 ——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————

 >  NX   Ran target build for project shared-sass (491ms)

    ✖    1/1 failed
    ✔    0/1 succeeded [0 read from cache]

   See Nx Cloud run details at https://nx.app/runs/Mt188xupcey
parisholley commented 2 years ago

@nhhockeyplayer i ran into this trying to use latest versions of everything and "@nrwl/remix": "14.1.7". the problem is that devkit is out of date in dependencies and you need to explicitly put latest in your package.json: "@nrwl/devkit": "14.2.4"

polpenaloza commented 2 years ago

Indeed, look for the rest of the @nrwl/ packages

github-actions[bot] commented 1 year 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.