nrwl / nx

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

ts-node not found after upgrade from nx v13 to v14 #10846

Closed batbrain9392 closed 2 years ago

batbrain9392 commented 2 years ago

After upgrade from "@nrwl/cli": "13.10.0" to "@nrwl/cli": "14.3.6", tests fail. This is probably due to the migration tool not installing ts-node. After manual installation of said package, the tests pass again.

Current Behavior

Jest tests fail after upgrading from "@nrwl/cli": "13.10.0" to "@nrwl/cli": "14.3.6".

Expected Behavior

Jest tests should pass after the upgrade.

Steps to Reproduce

  1. Create a typescript library project with nx 13.10.0
  2. Write a basic test and run; it should pass
  3. Upgrade the project to nx 14.3.6 using nx migrate
  4. Try to run the same test again; it should fail with the error given in the logs below

Check this commit for the issue.

Failure Logs

npx nx test codility

> nx run codility:test

Jest: Failed to parse the TypeScript config file /home/batbrain9392/Practice/ds-algo-practice/packages/codility/jest.config.ts
  Error: Jest: 'ts-node' is required for the TypeScript configuration files. Make sure it is installed
Error: Cannot find module 'ts-node'
Require stack:
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/jest-config/build/readConfigFileAndSetRootDir.js
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/jest-config/build/index.js
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/@nrwl/jest/src/executors/jest/jest.impl.js
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/nx/src/config/workspaces.js
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/nx/src/command-line/run.js
- /home/batbrain9392/Practice/ds-algo-practice/node_modules/nx/bin/run-executor.js

Environment

npx nx report

 >  NX   Report complete - copy this into the issue template

   Node : 16.15.1
   OS   : linux x64
   npm  : 8.12.2

   nx : 14.3.6
   @nrwl/angular : Not Found
   @nrwl/cypress : Not Found
   @nrwl/detox : Not Found
   @nrwl/devkit : 14.3.6
   @nrwl/eslint-plugin-nx : 14.3.6
   @nrwl/express : Not Found
   @nrwl/jest : 14.3.6
   @nrwl/js : 14.3.6
   @nrwl/linter : 14.3.6
   @nrwl/nest : Not Found
   @nrwl/next : Not Found
   @nrwl/node : Not Found
   @nrwl/nx-cloud : 14.1.2
   @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.3.6
   typescript : 4.7.4
   ---------------------------------------
   Community plugins:

(node:35696) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /home/batbrain9392/Practice/ds-algo-practice/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
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.