Git Product home page Git Product logo

pnpm-nx-monorepo-example's Introduction

pnpm-nx-monorepo-example's People

Contributors

javierbrea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pnpm-nx-monorepo-example's Issues

Could not find 'nx' module in this workspace.

Hey @javierbrea,

thanks for this post https://www.javierbrea.com/blog/pnpm-nx-monorepo-02/. I build a mono-repo based on your guide. I have one app named myapp and two packages named shared-ui and shared-features.

To build myapp I have following nx-configuration:

"targetDependencies": {
    "start": [
      {
        "target": "build",
        "projects": "dependencies"
      }
    ]
  }

I think nowadays, it could be changed to:

  "targetDefaults": {
    "start": {
      "dependsOn": ["^build"]
    }
  }

Doesn't matter! Either way, I get the following error when I try to start myapp and use latest nx. The packages are built properly, but the myapp start fails.

f I call pnpm nx start myapp, I get following error:

dist/select-utils-14284a03.js              2.84 kB │ gzip: 1.06 kB
✓ built in 3.01s

> nx run myapp:start

Could not find 'nx' module in this workspace. Error: Invalid source or target versions. Source: 5.0, Target: 5.1.
Only backwards compatibility between "5.1" and "5.0" is supported.
This error can be caused by "@nrwl/..." packages getting out of sync or outdated project graph cache.
Check the versions running "nx report" and/or remove your "nxdeps.json" file (in node_modules/.cache/nx folder).

It seems the reason is, that nx is installed as a dep of the workspace, as you also prefer and therefore nx run myapp:start get called without pnpm prefixed. What do you think. Do you know, how I can fix this?

Thanks and best regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.