Florian Wendelborn
Florian Wendelborn

Reputation: 1757

npm package not executed on linux

Today I tried to publish an own npm package. When installing it via

    npm install symlinker -g

it should be executable as

    symlinker (args)

This will work using Windows but I couldn't execute it via Linux (Raspberry Pi). Using linux it will output the following error (command: symlinker):

    : No such file or directory

My first guess was that it might be a problem with the nodejs executable which is be default "node" (Windows) and "nodejs" (Linux). Somehow I managed to install nodejs as "node" on my Raspberry Pi so that this can't be the problem. As this is my first try to publish a npm package I think that it's most likely an package.json fault.

github repository

Any idea what could cause the problem? Is it the fault of my Raspberry Pi or the configuration of it or is it caused by my npm package?

Upvotes: 2

Views: 651

Answers (1)

Cookies
Cookies

Reputation: 685

This is probably caused due to two reasons,

1. The executable nodejs binary doesn't have proper executable permissions.

2. There is no proper CRLF after your #!/usr/bin/env node at the top of the binary file that you are trying to execute.

Both of the above problems occur, when you try to publish a package from windows and install it using npm from a linux machine.

Try solving the problems 1 and 2 manually. Or try publishing from a linux machine and try it again.

Hope that helps.

Upvotes: 2

Related Questions