December 14, 2020 - Fix for Error (Missing write access to /usr/lib/node_modules)


PHOTO EMBED

Tue Dec 15 2020 00:24:40 GMT+0000 (UTC)

Saved by @dedicatedking #nodejs,angular

6.14.8
aviel@aihej-laptop:~$ npm install -g @angular/cli
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/lib/node_modules'
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:
npm ERR!     /home/aviel/.npm/_logs/2020-12-14T21_30_15_657Z-debug.log
aviel@aihej-laptop:~$ ng--version
ng--version: command not found
aviel@aihej-laptop:~$ ng --version

Command 'ng' not found, but can be installed with:

sudo apt install ng-common

aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ sudo npm install -g @angular/cli
npm WARN deprecated debug@4.2.0: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (https://github.com/visionmedia/debug/issues/797)
npm WARN deprecated ini@1.3.5: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng

> @angular/cli@11.0.4 postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/postinstall/script.js

? Would you like to share anonymous usage data with the Angular Team at Google under
Google’s Privacy Policy at https://policies.google.com/privacy? For more details and
how to change this setting, see http://angular.io/analytics. No
+ @angular/cli@11.0.4
added 254 packages from 201 contributors in 18.073s
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
aviel@aihej-laptop:~$ ^C
content_copyCOPY

Using sudo before npm install solved this problem