Cannot publish NPM package: env: ‘to’: No such file or directory

I am trying to publish a simple NPM package:

When trying to deploy the package to NPM however, the following error arises:


Installing deploy dependencies

Fetching: dpl-npm-1.10.13.gem (100%)

Successfully installed dpl-npm-1.10.13

1 gem installed


Preparing deploy

NPM version: 6.12.0

Authenticated with email and API key ****************ypt]


Deploying application

NPM API key format changed recently. If your deployment fails, check your API key in ~/.npmrc.

~/.npmrc size: 48

env: ‘to’: No such file or directory

Done. Your build exited with 0.

Running npm run build && npm publish locally works.

This is the job:

Did it ever work? If so, please point to a successful deployment.

No, sadly it didn’t. I basically did a clean travis setup npm, and it didn’t work.

The error must be happening at Judging by the error message, NPM_API_KEY=#{option(:api_key)} has spaces and “to” is the word after the first space.

1 Like

The weird error message is thus due to not sanitizing shell input. Normally, it would rather say something like “invalid API key”.

1 Like

@native-api Thank you so much for your help! I simply forgot to add the --pro flag when I used the travis setup npm command. Here is a working build now: