npm path is wrong

Issue #17 resolved
Danilo Tuler created an issue

I installed node (and npm) in the server, which is a ubuntu, using apt-get. I have node at /usr/bin/nodejs and npm at /usr/bin/npm When I detect the server capabilities Node.js is correctly created. No entry for npm is created, but I guess this is normal.

However, when I run a npm task the following error happens:

03-Jul-2014 21:33:51 Starting task 'Install Packages' of type 'com.atlassian.bamboo.plugins.bamboo-nodejs-plugin:task.builder.npm' 03-Jul-2014 21:33:51 Unable to find executable at /usr/bin/nodejsnpm. Will try to run it anyway. 03-Jul-2014 21:33:51 Failing task since return code of [/usr/bin/nodejsnpm install] was -1 while expected 0

I guess the npm path is being built wrongly, with no space between node and npm, at: https://bitbucket.org/atlassian/bamboo-nodejs-plugin/src/2f9675fb7c1a70e193731d2c6c7cf5ee379acff4/src/main/java/com/atlassian/bamboo/plugins/nodejs/tasks/npm/NpmTaskType.java?at=master#cl-56

Comments (5)

  1. Andy Fleming

    I have the same issue.

    My current workaround is to just specify /usr/bin/npm as a Custom command executable but it would be good if npm was included as part of the node plugin.

  2. Danilo Tuler reporter

    My workaround was to edit the Node.js capability path to /usr/bin/node instead of the auto-detected which was pointing to /usr/bin/nodejs When I installed node using apt-get it created the executable at /usr/bin/nodejs and a link at /usr/bin/node. This links points to /etc/alternatives/node, which is also a link pointing to /usr/bin/nodejs

  3. Andy Fleming

    Tried that @tuler, but got:

    08-Jul-2014 10:52:37    Unable to find executable at /usr/bin/npmnpm. Will try to run it anyway.
    

    So still looks like it needs something tweaked in the plugin itself, as the npm command is still being appended without any space or delimeter to whatever the node binary is set to.

  4. Log in to comment