dynatrace-oss / barista

Barista - the Dynatrace design system. Tailored to scale.
https://barista.dynatrace.com
Apache License 2.0
143 stars 78 forks source link

[npm run lint] error on windows: xargs is not recognized as an internal or external command #1554

Closed christian-fischer closed 4 years ago

christian-fischer commented 4 years ago

Bug Report

Expected Behavior

No error when running npm run lint on windows.

Current Behavior

'xargs' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! @dynatrace-oss/barista@8.0.0 bazel:stylelint: `bazelisk query "attr(generator_function, stylelint, //...)" | xargs bazelisk test`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the @dynatrace-oss/barista@8.0.0 bazel:stylelint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Steps to Reproduce

  1. run npm run lint on a windows system

Context (Environment)

Windows

Used Versions:

lukasholzer commented 4 years ago

Hey @christian-fischer please install the msys2 package for windows to be able to run this command.

I updated the development section https://github.com/dynatrace-oss/barista/pull/1575/files to provide in-depth instruction for windows users.

When you enter wehre bash in your command prompt it has to return C:\msys64\usr\bin\bash.exe it is important to have the msys64 in your PATH environment variable:

image

christian-fischer commented 4 years ago

Thanks @lukasholzer , I followed your updated instructions to install msys2, bazel and vs build c++ tools.

C:\workspaces\barista>where bash
C:\msys64\usr\bin\bash.exe
C:\Program Files\Git\usr\bin\bash.exe

Now I'm faced with the following error output when running npm run lint:

The system cannot find the path specified.

    at ChildProcess.exithandler (child_process.js:295:12)
    at ChildProcess.emit (events.js:210:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  killed: false,
  code: 1,
  signal: null,
  cmd: 'C:\\workspaces\\barista\\node_modules\\.bin\\ngc -p view-engine-tsconfig.json'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @dynatrace-oss/barista@8.0.0 postinstall: `node postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @dynatrace-oss/barista@8.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
lukasholzer commented 4 years ago

@christian-fischer please update with the latest master as the fix for this is already merged :)

christian-fischer commented 4 years ago

@lukasholzer I just pulled the latest upstream master and ran npm run lint again:

FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)
npm ERR! code ELIFECYCLE
npm ERR! errno 123
npm ERR! @dynatrace-oss/barista@8.0.0 bazel:stylelint: `bazelisk query "attr(generator_function, stylelint, //...)" | xargs bazelisk test`
npm ERR! Exit status 123
npm ERR!
npm ERR! Failed at the @dynatrace-oss/barista@8.0.0 bazel:stylelint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\christian.fischer\AppData\Roaming\npm-cache\_logs\2020-09-08T10_43_58_082Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 123
npm ERR! @dynatrace-oss/barista@8.0.0 lint: `nx workspace-lint && npm run affected:lint -- --parallel && npm run bazel:stylelint`
npm ERR! Exit status 123
npm ERR!
npm ERR! Failed at the @dynatrace-oss/barista@8.0.0 lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\christian.fischer\AppData\Roaming\npm-cache\_logs\2020-09-08T10_43_58_133Z-debug.log

before that, there are 75 loglines repeating the following message: ': target names may not end with carriage returns (perhaps the input source is CRLF-terminated)

lukasholzer commented 4 years ago

@christian-fischer can confirm this error now on my remote windows setup :) will take a look! Sorry windows support is currently poor as we don't have windows ci resources and we are all Linux, mac devs or windows with WSL.

But I'm currently working in this sprint to fix all the windows bugs. Sorry for the inconvenience.

christian-fischer commented 4 years ago

Hmmm... adding "C:\msys64\usr\bin" to the path sadly has another undesired side effect: image All commits in eclipse are aborted in pre-commit hook. As soon as I remove msys from the path again, committing works again in eclipse. So I have to remove the msys path entry again ...

Looks like JGit (which is used by eclipse) behaves differently, when cygpath.exe is found on PATH - which would explain the side effect.

ffriedl89 commented 4 years ago

Moved to interal issue tracking