Comments (9)
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.
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.
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.
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.
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:
- install Node.js: https://github.com/kmalakoff/node-install-release.
$ nri [version string]
- 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.
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.
this is particularly unfortunate since the example is actually part of the official documentation.
see circleci/circleci-docs#5611
from node-orb.
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.
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)
- Support pnpm HOT 3
- Change log
- "max-workers" as a parameter or a step to check the size of resource class
- Upgrade Yarn Install Command to Berry HOT 3
- Install Job Fails - Out of sync HOT 1
- Node has issues installing. HOT 1
- Prevent nvm from falling back to building from source HOT 2
- Inability to install requested NodeJS version does not break the build
- May need to be able to pass http session type to the curl commands HOT 1
- Support Bun
- Latest container no longer includes `node-gyp`
- Node fails to download HOT 2
- Change `install-packages` `include-branch-in-cache-key` default to `false` HOT 1
- Caching fails if no lockfile exists HOT 3
- Cache created but ignored by default HOT 2
- install-yarn fails stating sudo command not found
- In yarn-berrry, node_modules are not cached causing the native binaries to be rebuild every time
- install-yarn does not work on machine executors
- Installing yarn-berry does not seem to work HOT 1
- https://hub.docker.com/r/cimg/node
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-orb.