Windows + node, npm not found after node/install

Hello! I am trying to make my CI pipeline run tests on Windows. I am failing to figure out how to run npm.

My config:

version: 2.1

orbs:
  win: circleci/windows@5.0 
  node: circleci/node@5.1.0

jobs:
  checkout-win:
    executor: 
      name: win/default # executor type
      shell: bash.exe
    working_directory: C:\calva
    steps:
      - attach_workspace:
          at: C:\tmp
      - checkout:
          path: C:\calva
      - node/install
      - run:
          name: Install node_modules
          command: cp package.json /c/tmp && npm install && cp /c/tmp/package.json .
      ....

This crashes with:

#!bash.exe
cp package.json /c/tmp && npm install && cp /c/tmp/package.json .
bash: line 1: npm: command not found

Exited with code exit status 127
CircleCI received exit code 127

I’ve rerun the job with SSH and neither npm nor node are available as commands.

Anyone have a clue what I am doing wrong? Is this supposed to work?

Hello, the node orb for CircleCI does not officially support Windows. However, it should not be required. NVM is already installed in the Windows image, you can simply call your nvm commands such as:

nvm install 18 && nvm use 18

2 Likes

Thanks!

I had to give up testing on Windows because it ate up too much of my time and increased pipeline time several times over.

I’ll keep your answer in mind if I need to run on Windows in some other project.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.