Recent Changes - Search:

edit SideBar


This page is for developers and is about how to upload the accessors package to the Node Package Manager (npm).


To test the package before uploading it, do

cd $PTII
mkdir node_modules
npm install org/terraswarm/accessor/accessors/web
What this does is read $PTII/org/terraswarm/accessor/accessors/web/package.json and create $PTII/node_modules/@terraswarm/accessors/.

How to upload

For this to work, you will need the terraswarm npm password. (See Accounts (group access only) and look in ealprivi/passwords/terra-npmjs.txt)

  1. cd accessors/web
  2. Increment the version number in accessors/web/package.json. To upload a new version of the module, npm requires that the version number be incremented.
  3. Login:
    bash-3.2$ npm login
    Username: terraswarm

    Email: (this IS public)

    Logged in as terraswarm on
  4. Upload:
    bash-3.2$ pwd
    bash-3.2$ npm publish --access=public
    + @terraswarm/accessors@0.0.13

Upload Synopsis

Below is roughly how the upload occurred. This information is mainly for debugging.

  1. Created an account via
  2. Created accessors/web/package.js by running npm init. See Using A Package ( docs)
  3. Edited accessors/web/package.js by hand and added some items after reviewing the jshints package.js file.
      "name": "@terraswarm/accessors",
      "version": "0.0.1",
      "description": "Actor-oriented proxies for IoT",
      "main": "hosts/node/nodeHost.js",
      "author": {
        "name": "Edward A. Lee and others",
        "email": "",
        "url": ""
      "directories": {
        "doc": "doc",
        "test": "test"
      "homepage": "{$ACCESSORS_HOME}/",
      "keywords": [
      "repository": {
        "type": "svn",
        "url": ""
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"

      "license": "SEE LICENSE IN accessors-license.htm"
    Things to notice
    1. "name": "@terraswarm/accessors", - The package is in the @terraswarm npm scope
    2. "main": "hosts/node/nodeHost.js", - The main file is located at this location.
  4. Ran npm login, and used my terraswarm credential, for the password, see Accounts (group access only)and look in ealprivi/passwords/terra-npmjs.txt


  1. Ran npm publish --access=public, which published it.
  2. To test, see Installing Using NPM

See Also

Edit - History - Print - Recent Changes - Search
Page last modified on June 12, 2019, at 12:01 PM