Publishing org scoped npm packages with travis

by Christian Fei @ 2018-11-28

84 words, 1 minute reading time

#post #javascript #nodejs #tutorial #featured 

If you stumbled upon this article, you are probably seeing the following error message on travis in the deployment stage:

Deploying application
npm ERR! publish Failed PUT 402
npm ERR! code E402
npm ERR! You must sign up for private packages : @christian_fei/pocket-sync

Btw, this is the .travis.yml configuraiton:

language: node_js
node_js:
  - "10"
script:
  - echo "deploying to npm"
deploy:
  provider: npm
  email: [email protected]
  api_key: $NPM_TOKEN
  on:
    tags: true

To fix it, open your package.json and add the following configuration:

"publishConfig": {
  "access": "public"
},

FEEDBACK @christian_fei

Featured blog posts

Twitter oauth by example in node.js So long, and thanks for all the veggies Simplest vanilla javascript static site blog search for jekyll, hugo, 11.ty Minimal environments with dotenv and node.js Connect to mongodb with monk in node.js Lazy loading images in 2020 Recover from failed `lerna` publish The cleanest way to maintain connect / express middlewares in node.js Better web scraping with node.js My blogging stack in 2020