Giter Site home page Giter Site logo

Windows support about node-orb HOT 9 CLOSED

circleci-public avatar circleci-public commented on June 26, 2024 4
Windows support

from node-orb.

Comments (9)

Kurt-von-Laven avatar Kurt-von-Laven commented on June 26, 2024 3

We no longer use CircleCI, so I'm not sure how helpful my input is to you, but one reason I could think of might be to run a static analysis tool like cspell or jscpd that ships as an npm package. We use MegaLinter instead, but I know some projects may prefer a lighter-weight approach of installing only one or a few linters manually.

from node-orb.

Kurt-von-Laven avatar Kurt-von-Laven commented on June 26, 2024 2

I believe the new advanced conditionals may allow us to bake in Windows support automatically now. Looking into this.

https://discuss.circleci.com/t/advanced-logic-in-config/36011

I may be missing something here, but could one set a variable to the default shell option on Linux and MacOS, but bash.exe on Windows, and then slap shell: on every run statement? Lack of Windows support is a problem with almost all orbs (even the Slack orb) presently if I understand correctly though. Rather than support Windows in each orb one-by-one, I would suggest addressing this issue more structurally by, for instance, allowing the default shell to be changed or offering some other sort of cross-platform mode.

from node-orb.

KyleTryon avatar KyleTryon commented on June 26, 2024

Hello @kmalakoff,

This orb in its current state would not work on Windows, unless perhaps you were looking to install Node in the WSL portion of Windows.

This orb in its current form expects that it will be running in a terminal shell (not powershell), which allows it to work on MacOS and Linux. We could implement a windows specific node orb or Windows versions of the commands in this orb.

This is an incredibly cool and efficient config setup you have here however, I would love to get to the point of supporting this.

In this configuration, is not node attempting to install itself on the node docker image too?

Between Linux and Mac I think the configuration you have will work, I am not sure if it will be possible to get something As simple when windows is involved, we may at minimum need to separate those jobs with separate commands.

from node-orb.

KyleTryon avatar KyleTryon commented on June 26, 2024

I believe the new advanced conditionals may allow us to bake in Windows support automatically now. Looking into this.

https://discuss.circleci.com/t/advanced-logic-in-config/36011

from node-orb.

kmalakoff avatar kmalakoff commented on June 26, 2024

Thank you for the updates Kyle.

I spent some time going down the rabbit hole of running Node.js in a cross-platform way (nave, nvm, nvm-windows, etc) and decided to write cross-platform scripts directly in JavaScript given your base images come pre-installed with Node.js.

I released a couple of modules:

  1. install Node.js: https://github.com/kmalakoff/node-install-release.

$ nri [version string]

  1. run a specific version of Node.js: https://github.com/kmalakoff/node-version-use

$ nvu [version string] [command and arguments]

If you can assume Node.js is already installed in the base image, it might be easier to write in JavaScript.

from node-orb.

brandonros avatar brandonros commented on June 26, 2024
version: 2.1
orbs:
  win: circleci/[email protected]
  node: circleci/[email protected]
jobs:
  build:
    executor:
      name: win/default
      shell: bash.exe
    working_directory: ~/repo/electron
    steps:
      - checkout
      - node/install
      - run:
          name: Update NPM
          command: "npm.exe install -g npm"
      - restore_cache:
          key: dependency-cache-{{ checksum "package.json" }}
      - run:
          name: Install Dependencies
          command: "npm.exe install"
      - save_cache:
          key: dependency-cache-{{ checksum "package.json" }}
          paths:
            - ./node_modules
      - run:
          name: Generate Builds
          command: "npm.exe run build:windows"
      - store_artifacts:
          path: ~/repo/out/make

so, this doesn't work? :(

Latest version of NPM is 6.14.8
Something went wrong; the specified version of NPM could not be installed

from node-orb.

duncdrum avatar duncdrum commented on June 26, 2024

this is particularly unfortunate since the example is actually part of the official documentation.
see circleci/circleci-docs#5611

from node-orb.

Jaryt avatar Jaryt commented on June 26, 2024

Hi All! We're reevaluating this and are looking for some more specific use cases regarding using this orb with windows. I might expect the installation command to be replaced with something like chocolately.

As @Kurt-von-Laven said, it's more about a interoperability problem with orbs that we feel may be necessary to be focused on before implementing a patch solution for this orb specifically.

from node-orb.

Jaryt avatar Jaryt commented on June 26, 2024

Wanted to double check to ensure that this issue is still valid, and after some testing I found that Windows works perfectly fine with the Node orb as long as the executor's shell is set to bash :)

Closing out!

from node-orb.

Related Issues (20)

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.