1
votes

I am trying to build a project in TeamCity server. The only build step is to run npm install

For this I created the following build step:

Runner type: Command Line

Step name: Install

Run: Executable with parameters

Command executable: npm install

Command parameters: none

This command gives the following error:

[15:51:51] Step 1/1: Install (Command Line)

[15:51:51] [Step 1/1] Starting: npm install

[15:51:51] [Step 1/1] in directory: /path/to/repo/TeamCity/buildAgent/work/26cbe246a44af5d8

[15:51:51] [Step 1/1] Cannot run process npm install : file not found

[15:51:51] [Step 1/1] Step Install (Command Line) failed with unexpected error

[15:51:52] Publishing internal artifacts

[15:51:52] [Publishing internal artifacts] Publishing 1 file using [WebPublisher]

[15:51:52] [Publishing internal artifacts] Publishing 1 file using [ArtifactsCachePublisher] [15:51:52] Build finished

Why can't my build agent not able to run a simple npm install?

2

2 Answers

1
votes

It was trying to locate npm install command instead of npm.

So, I set install as a command parameter and not the command itself like so:

Command executable: npm

Command parameters: install

...and it worked

-1
votes

What is the output from executing npm? Do you have it installed in the agent that is running the build?