angularjsnode.jsnpmelectronsinopia

npm sinopia installation faled


I am trying to install sinopia for electron updater globally but am getting the following error:

npm install -g sinopia
npm WARN deprecated minimatch@1.0.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    npm WARN deprecated node-uuid@1.4.3: Use uuid module instead
    npm WARN deprecated tough-cookie@1.2.0: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130
    npm WARN deprecated is-my-json-valid@2.12.0: catastrophic backtracking in regexes could potentially lead to REDOS attack, upgrade to 2.17.2 as soon as possible
    npm WARN checkPermissions Missing write access to /usr/lib/node_modules/sinopia
    npm WARN checkPermissions Missing write access to /usr/lib/node_modules/sinopia/node_modules
    npm ERR! path /usr/lib/node_modules/sinopia
    npm ERR! code EACCES
    npm ERR! errno -13
    npm ERR! syscall access
    npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules/sinopia'
    npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules/sinopia'
    npm ERR!   stack: 'Error: EACCES: permission denied, access    '/usr/lib/node_modules/sinopia\'',
    npm ERR!   errno: -13,
    npm ERR!   code: 'EACCES',
    npm ERR!   syscall: 'access',
    npm ERR!   path: '/usr/lib/node_modules/sinopia' }
    npm ERR! 
    npm ERR! Please try running this command again as root/Administrator.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /home/indranil/.npm/_logs/2018-03-19T13_37_02_356Z-debug.log

Below is my debug Debug Log from /home/indranil/.npm/_logs/2018-03-19T13_37_02_356Z-debug.log.

542 silly install generateActionsToTake
543 warn checkPermissions Missing write access to /usr/lib/node_modules/sinopia
544 warn checkPermissions Missing write access to /usr/lib/node_modules/sinopia/node_modules
545 verbose stack Error: EACCES: permission denied, access '/usr/lib/node_modules/sinopia'
546 verbose cwd /home/indranil
547 verbose Linux 4.13.0-37-generic
548 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "sinopia"
549 verbose node v8.10.0
550 verbose npm  v5.7.1
551 error path /usr/lib/node_modules/sinopia
552 error code EACCES
553 error errno -13
554 error syscall access
555 error Error: EACCES: permission denied, access '/usr/lib/node_modules/sinopia'
555 error  { Error: EACCES: permission denied, access '/usr/lib/node_modules/sinopia'
555 error   stack: 'Error: EACCES: permission denied, access \'/usr/lib/node_modules/sinopia\'',
555 error   errno: -13,
555 error   code: 'EACCES',
555 error   syscall: 'access',
555 error   path: '/usr/lib/node_modules/sinopia' }
556 error Please try running this command again as root/Administrator.
557 verbose exit [ -13, true ]

As suggested in the debug log, I have already checked the permission to the directory. But the installer deletes and re-creates the directory on installation.

Any suggestion?


Solution

  • The error says clearly what's wrong:

    EACCES: permission denied, access '/usr/lib/node_modules/sinopia'

    And also provides a solution:

    Please try running this command again as root/Administrator

    So, just run the command as an administrator, like this: sudo npm install -g sinopia.