Reputation: 1
So I'm following the preparatory steps to create my smart contract but when I want to install a certain version of npm I get endless permission warnings, check it out, it's wild. I probably broke my terminal or something.
npm install -g [email protected]
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/aproba
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/are-we-there-yet/node_modules/string_decoder
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/asap
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/assert-plus
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/asynckit
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/aws-sign2
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/aws4
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/balanced-match
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/bluebird
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/buffer-from
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/builtins
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/byline
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/byte-size
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/camelcase
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/capture-stack-trace
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/caseless
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/chownr
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/ci-info
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/cli-boxes
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/cliui/node_modules/ansi-regex
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/cliui/node_modules/strip-ansi
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/clone
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/co
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/code-point-at
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/color-name
/** npm WARN checkPermissions GOES ON FOREVER ...
/** and ever
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/read
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/sorted-union-stream/node_modules/from2
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/npm/node_modules/validate-npm-package-name
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules/npm/node_modules/aproba
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/aproba'
npm ERR! [Error: EACCES: permission denied, access '/usr/local/lib/node_modules/npm/node_modules/aproba'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/usr/local/lib/node_modules/npm/node_modules/aproba'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
npm ERR! A complete log of this run can be found in:
Upvotes: 0
Views: 971
Reputation: 1
Ok, so I found a way around it, trying to repair my permissions did not work...
git clone git://github.com/creationix/nvm.git ~/.nvm
then source ~/.nvm/nvm.sh
--> see: Node Version Manager install - nvm command not foundso happy! no error messages this time :D
Upvotes: 0
Reputation: 70115
You need to either install with sudo
or else change the permissions recursively on /usr/local/lib/node_modules/npm/node_modules
and possibly one or more parent directories. You are trying to install npm
in a system directory, so that usually requires administrative access (so put sudo
before the command: sudo npm install -g [email protected]
). If you are the only user on the system and you don't expect that to change, then changing permissions on the directory will work too).
Another solution, if you are wanting to use this for development purposes only and especially if you think you'll want to switch between versions of node
a lot, would be to use a version manager like nvm
. Install nvm
and you won't need to use sudo
to upgrade/downgrade npm
because you will be running it out of subdirectory of your home directory.
Upvotes: 1