0

I'm in users/local/blackmanr and i have already installed npm, node, and ionic. For some reason when installing cordova in terminal I'm getting some sort of error (see below).

SANDMCRDMACP002-90:~ blackmanr$ npm install -g cordova
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/cordova
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/cordova/node_modules
/usr/local/lib
└─┬ cordova@6.4.0 
  ├─┬ cordova-lib@6.4.0
  │ └─┬ npm@2.15.11
  │   ├── abbrev@1.0.9 
  │   ├── ansi@0.3.1 
  │   ├── ansi-regex@2.0.0 
  │   ├── ansicolors@0.3.2 
  │   ├── ansistyles@0.1.3 
  │   ├── archy@1.0.0 
  │   ├── async-some@1.0.2 
  │   ├── block-stream@0.0.9 
  │   ├── char-spinner@1.0.1 
  │   ├── chmodr@1.0.2 
  │   ├── chownr@1.0.1 
  │   ├── cmd-shim@2.0.2 
  │   ├─┬ columnify@1.5.4 
  │   │ └─┬ wcwidth@1.0.0 
  │   │   └─┬ defaults@1.0.3 
  │   │     └── clone@1.0.2 
  │   ├─┬ config-chain@1.1.10 
  │   │ └── proto-list@1.2.4 
  │   ├─┬ dezalgo@1.0.3 
  │   │ └── asap@2.0.3 
  │   ├── editor@1.0.0 
  │   ├── fs-vacuum@1.2.9 
  │   ├─┬ fs-write-stream-atomic@1.0.8 
  │   │ └── iferr@0.1.5 
  │   ├── fstream@1.0.10 
  │   ├─┬ fstream-npm@1.1.1 
  │   │ └── fstream-ignore@1.0.5 
  │   ├── github-url-from-git@1.4.0 
  │   ├── github-url-from-username-repo@1.0.2 
  │   ├─┬ glob@7.0.6 
  │   │ ├── fs.realpath@1.0.0 
  │   │ └── path-is-absolute@1.0.0 
  │   ├── graceful-fs@4.1.6 
  │   ├── hosted-git-info@2.1.5 
  │   ├── imurmurhash@0.1.4 
  │   ├── inflight@1.0.5 
  │   ├── inherits@2.0.3 
  │   ├── ini@1.3.4 
  │   ├─┬ init-package-json@1.9.4 
  │   │ ├─┬ glob@6.0.4 
  │   │ │ └── path-is-absolute@1.0.0 
  │   │ └── promzard@0.3.0 
  │   ├── lockfile@1.0.1 
  │   ├─┬ lru-cache@4.0.1 
  │   │ ├── pseudomap@1.0.2 
  │   │ └── yallist@2.0.0 
  │   ├─┬ minimatch@3.0.3 
  │   │ └─┬ brace-expansion@1.1.6 
  │   │   ├── balanced-match@0.4.2 
  │   │   └── concat-map@0.0.1 
  │   ├─┬ mkdirp@0.5.1 
  │   │ └── minimist@0.0.8 
  │   ├─┬ node-gyp@3.4.0 
  │   │ └─┬ path-array@1.0.1 
  │   │   └─┬ array-index@1.0.0 
  │   │     ├─┬ debug@2.2.0 
  │   │     │ └── ms@0.7.1 
  │   │     └─┬ es6-symbol@3.1.0 
  │   │       ├── d@0.1.1 
  │   │       └─┬ es5-ext@0.10.12 
  │   │         └── es6-iterator@2.0.0 
  │   ├── nopt@3.0.6 
  │   ├── normalize-git-url@3.0.2 
  │   ├─┬ normalize-package-data@2.3.5 
  │   │ └─┬ is-builtin-module@1.0.0 
  │   │   └── builtin-modules@1.1.0 
  │   ├── npm-cache-filename@1.0.2 
  │   ├── npm-install-checks@1.0.7 
  │   ├── npm-package-arg@4.1.0 
  │   ├─┬ npm-registry-client@7.2.1 
  │   │ ├─┬ concat-stream@1.5.2 
  │   │ │ ├─┬ readable-stream@2.0.6 
  │   │ │ │ ├── core-util-is@1.0.2 
  │   │ │ │ ├── isarray@1.0.0 
  │   │ │ │ ├── process-nextick-args@1.0.7 
  │   │ │ │ ├── string_decoder@0.10.31 
  │   │ │ │ └── util-deprecate@1.0.2 
  │   │ │ └── typedarray@0.0.6 
  │   │ └── retry@0.10.0 
  │   ├── npm-user-validate@0.1.5 
  │   ├─┬ npmlog@2.0.4 
  │   │ ├─┬ are-we-there-yet@1.1.2 
  │   │ │ └── delegates@1.0.0 
  │   │ └─┬ gauge@1.2.7 
  │   │   ├── has-unicode@2.0.0 
  │   │   ├─┬ lodash.pad@4.4.0 
  │   │   │ ├── lodash._baseslice@4.0.0 
  │   │   │ ├── lodash._basetostring@4.12.0 
  │   │   │ └── lodash.tostring@4.1.4 
  │   │   ├── lodash.padend@4.5.0 
  │   │   └── lodash.padstart@4.5.0 
  │   ├── once@1.4.0 
  │   ├── opener@1.4.1 
  │   ├─┬ osenv@0.1.3 
  │   │ ├── os-homedir@1.0.0 
  │   │ └── os-tmpdir@1.0.1 
  │   ├── path-is-inside@1.0.1 
  │   ├─┬ read@1.0.7 
  │   │ └── mute-stream@0.0.5 
  │   ├─┬ read-installed@4.0.3 
  │   │ ├── debuglog@1.0.1 
  │   │ ├── readdir-scoped-modules@1.0.2 
  │   │ └── util-extend@1.0.1 
  │   ├─┬ read-package-json@2.0.4 
  │   │ ├─┬ glob@6.0.4 
  │   │ │ └── path-is-absolute@1.0.0 
  │   │ └─┬ json-parse-helpfulerror@1.0.3 
  │   │   └── jju@1.3.0 
  │   ├─┬ readable-stream@2.1.5 
  │   │ ├── buffer-shims@1.0.0 
  │   │ ├── core-util-is@1.0.2 
  │   │ ├── isarray@1.0.0 
  │   │ ├── process-nextick-args@1.0.7 
  │   │ ├── string_decoder@0.10.31 
  │   │ └── util-deprecate@1.0.2 
  │   ├── realize-package-specifier@3.0.1 
  │   ├─┬ request@2.74.0 
  │   │ ├── aws-sign2@0.6.0 
  │   │ ├── aws4@1.4.1 
  │   │ ├─┬ bl@1.1.2 
  │   │ │ └─┬ readable-stream@2.0.6 
  │   │ │   ├── core-util-is@1.0.2 
  │   │ │   ├── isarray@1.0.0 
  │   │ │   ├── process-nextick-args@1.0.7 
  │   │ │   ├── string_decoder@0.10.31 
  │   │ │   └── util-deprecate@1.0.2 
  │   │ ├── caseless@0.11.0 
  │   │ ├─┬ combined-stream@1.0.5 
  │   │ │ └── delayed-stream@1.0.0 
  │   │ ├── extend@3.0.0 
  │   │ ├── forever-agent@0.6.1 
  │   │ ├─┬ form-data@1.0.0-rc4 
  │   │ │ └── async@1.5.2 
  │   │ ├─┬ har-validator@2.0.6 
  │   │ │ ├─┬ chalk@1.1.3 
  │   │ │ │ ├── ansi-styles@2.2.1 
  │   │ │ │ ├── escape-string-regexp@1.0.5 
  │   │ │ │ ├── has-ansi@2.0.0 
  │   │ │ │ └── supports-color@2.0.0 
  │   │ │ ├─┬ commander@2.9.0 
  │   │ │ │ └── graceful-readlink@1.0.1 
  │   │ │ ├─┬ is-my-json-valid@2.13.1 
  │   │ │ │ ├── generate-function@2.0.0 
  │   │ │ │ ├─┬ generate-object-property@1.2.0 
  │   │ │ │ │ └── is-property@1.0.2 
  │   │ │ │ ├── jsonpointer@2.0.0 
  │   │ │ │ └── xtend@4.0.1 
  │   │ │ └─┬ pinkie-promise@2.0.1 
  │   │ │   └── pinkie@2.0.4 
  │   │ ├─┬ hawk@3.1.3 
  │   │ │ ├── boom@2.10.1 
  │   │ │ ├── cryptiles@2.0.5 
  │   │ │ ├── hoek@2.16.3 
  │   │ │ └── sntp@1.0.9 
  │   │ ├─┬ http-signature@1.1.1 
  │   │ │ ├── assert-plus@0.2.0 
  │   │ │ ├─┬ jsprim@1.3.0 
  │   │ │ │ ├── extsprintf@1.0.2 
  │   │ │ │ ├── json-schema@0.2.2 
  │   │ │ │ └── verror@1.3.6 
  │   │ │ └─┬ sshpk@1.9.2 
  │   │ │   ├── asn1@0.2.3 
  │   │ │   ├── assert-plus@1.0.0 
  │   │ │   ├── dashdash@1.14.0 
  │   │ │   ├── ecc-jsbn@0.1.1 
  │   │ │   ├── getpass@0.1.6 
  │   │ │   ├── jodid25519@1.0.2 
  │   │ │   ├── jsbn@0.1.0 
  │   │ │   └── tweetnacl@0.13.3 
  │   │ ├── is-typedarray@1.0.0 
  │   │ ├── isstream@0.1.2 
  │   │ ├── json-stringify-safe@5.0.1 
  │   │ ├─┬ mime-types@2.1.11 
  │   │ │ └── mime-db@1.23.0 
  │   │ ├── node-uuid@1.4.7 
  │   │ ├── oauth-sign@0.8.2 
  │   │ ├── qs@6.2.1 
  │   │ ├── stringstream@0.0.5 
  │   │ ├── tough-cookie@2.3.1 
  │   │ └── tunnel-agent@0.4.3 
  │   ├── retry@0.10.0 
  │   ├── rimraf@2.5.4 
  │   ├── semver@5.1.0 
  │   ├─┬ sha@2.0.1 
  │   │ └─┬ readable-stream@2.0.2 
  │   │   ├── core-util-is@1.0.1 
  │   │   ├── isarray@0.0.1 
  │   │   ├── process-nextick-args@1.0.3 
  │   │   ├── string_decoder@0.10.31 
  │   │   └── util-deprecate@1.0.1 
  │   ├── slide@1.1.6 
  │   ├── sorted-object@2.0.0 
  │   ├── spdx-license-ids@1.2.2 
  │   ├── strip-ansi@3.0.1 
  │   ├── tar@2.2.1 
  │   ├── text-table@0.2.0 
  │   ├── uid-number@0.0.6 
  │   ├── umask@1.1.0 
  │   ├─┬ validate-npm-package-license@3.0.1 
  │   │ ├── spdx-correct@1.0.2 
  │   │ └─┬ spdx-expression-parse@1.0.2 
  │   │   └── spdx-exceptions@1.0.4 
  │   ├─┬ validate-npm-package-name@2.2.2 
  │   │ └── builtins@0.0.7 
  │   ├─┬ which@1.2.11 
  │   │ └── isexe@1.1.2 
  │   ├── wrappy@1.0.2 
  │   └── write-file-atomic@1.1.4 
  └─┬ insight@0.8.4
    └─┬ request@2.79.0
      └─┬ http-signature@1.1.1
        └─┬ sshpk@1.10.1
          └── tweetnacl@0.14.4 

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! path /usr/local/lib/node_modules/cordova
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access

npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/cordova'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/cordova'
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/cordova' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/blackmanr/npm-debug.log
SANDMCRDMACP002-90:~ blackmanr$ sudo npm install -g cordova
Password:
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
/usr/local/lib
└── (empty)

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "cordova"
npm ERR! node v7.2.0
npm ERR! npm  v3.10.9
npm ERR! path /usr/local/lib/node_modules/.staging/abbrev-ef9cc920
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename '/usr/local/lib/node_modules/.staging/abbrev-ef9cc920' -> '/usr/local/lib/node_modules/cordova/node_modules/npm/node_modules/abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/blackmanr/npm-debug.log
npm ERR! code 1

Any ideas on what this might be?

2 Answers2

0

You should use NVM to manage your Node install. Easy upgrades to Node & NPM notwithstanding, nvm also installs modules to your user directory, to which you'd have write rights.

If you don't want to use a Node version manager, you should review the npm documentation at https://docs.npmjs.com/getting-started/fixing-npm-permissions. I would avoid option #1 unless nothing else works.

Kerri Shotts
  • 2,372
  • 1
  • 17
  • 19
  • Thank you! I tried the NVM, not really sure how it helps me? And, I looked into that link but no luck. – echoes-in-eternity Dec 02 '16 at 22:49
  • NVM is used to install node & npm local to your user profile. Make sure you follow all the installation steps (including adding NVM to your bash profile), and then install Cordova again. If you run into errors, please paste every command you tried. – Kerri Shotts Dec 05 '16 at 20:14
0

Try running that command from a terminal with elevated permissions (assuming you are on Windows):

  1. Go to start and search for CMD.
  2. Right click and choose Run as Administrator.
  3. Type: npm install -g cordova

If that fails, try this first: npm cache clean

EDIT: if on Linux, you might want to take a look at this page: npm throws error without sudo

Community
  • 1
  • 1
Sam
  • 845
  • 7
  • 20