Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG / REQUEST] When running npm install, dotnet restore is automatically fired - option to skip this #844

Open
elvince opened this issue Apr 8, 2024 · 1 comment
Labels
bug Something isn't working needs-triage This issue has yet to be looked over by a core team member

Comments

@elvince
Copy link

elvince commented Apr 8, 2024

Current Behavior

When running npm install for my React build dependencies, Dot not restore is automaticaly fired.
On this React build machine, dot net is not installed, as a consequence my build failed from a process that is not needed

Expected Behavior

Be able to skip restore or put restore as a warning and not error

Github Repo

No response

Steps to Reproduce

  1. Create a NX monorepo with React & donet project
  2. Launch npm install on a linux machine without dotnet

Nx Report

Node   : 20.9.0
OS     : win32-x64
npm    : 10.1.0

nx                 : 18.0.8
@nx/js             : 18.0.8
@nx/linter         : 18.0.8
@nx/eslint         : 18.0.8
@nx/workspace      : 18.0.8
@nx/devkit         : 18.0.8
@nx/eslint-plugin  : 18.0.8
@nx/react          : 18.0.8
@nrwl/tao          : 18.0.8
@nx/vite           : 18.0.8
@nx/web            : 18.0.8
typescript         : 5.3.3
---------------------------------------
Community plugins:
@nx-dotnet/core : 2.2.0

nx.json

{
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "namedInputs": {
    "default": ["{projectRoot}/**/*", "sharedGlobals"],
    "production": [
      "default",
      "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)",
      "!{projectRoot}/tsconfig.spec.json",
      "!{projectRoot}/.eslintrc.json",
      "!{projectRoot}/eslint.config.js",
      "!{projectRoot}/cypress/**/*",
      "!{projectRoot}/**/*.cy.[jt]s?(x)",
      "!{projectRoot}/cypress.config.[jt]s"
    ],
    "sharedGlobals": []
  },
  "plugins": [
    {
      "plugin": "@nx/vite/plugin",
      "options": {
        "buildTargetName": "build",
        "previewTargetName": "preview",
        "testTargetName": "test",
        "serveTargetName": "serve",
        "serveStaticTargetName": "serve-static"
      }
    },
    {
      "plugin": "@nx/eslint/plugin",
      "options": {
        "targetName": "lint"
      }
    },
    "@nx-dotnet/core"
  ],
  "generators": {
    "@nx/react": {
      "application": {
        "babel": true,
        "style": "scss",
        "linter": "eslint",
        "bundler": "vite"
      },
      "component": {
        "style": "scss"
      },
      "library": {
        "style": "scss",
        "linter": "eslint"
      }
    }
  },
  "defaultBase": "master"
}

Failure Logs

No response

Additional Information

No response

@elvince elvince added bug Something isn't working needs-triage This issue has yet to be looked over by a core team member labels Apr 8, 2024
@PingvinB
Copy link

I think this might caused by the "prepare": "nx g @nx-dotnet/core:restore" script that keeps getting added automatically to package.json.
This was supposedly fixed in 1.4.1 as a result of #101, but maybe it has regressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage This issue has yet to be looked over by a core team member
Projects
None yet
Development

No branches or pull requests

2 participants