Tuesday, May 8, 2018

angular install fails me again!!

 npm install -g @angular/cli
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm ERR! path /usr/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/lib/node_modules'
npm ERR!   stack: '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! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/progr/.npm/_logs/2018-05-08T10_19_18_241Z-debug.log

https://github.com/npm/npm/issues/2049
https://github.com/hexojs/hexo/issues/2545

 sudo npm install -g @angular/cli
/usr/bin/ng -> /usr/lib/node_modules/@angular/cli/bin/ng

> @angular/cli@6.0.0 postinstall /usr/lib/node_modules/@angular/cli
> node ./bin/ng-update-message.js

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.3 (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/cli@6.0.0
added 253 packages in 56.11s


 ng new my-app
/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/hostReportError.js:9
    setTimeout(function () { throw err; });
                             ^

Error: EACCES: permission denied, mkdir '/my-app'
    at Object.fs.mkdirSync (fs.js:885:18)
    at _createDir (/usr/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/node/host.js:151:20)
    at Observable.rxjs_1.Observable.obs [as _subscribe] (/usr/lib/node_modules/@angular/cli/node_modules/@angular-devkit/core/node/host.js:153:13)
    at Observable.subscribe (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:162:69)
    at /usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:22:31
    at Object.subscribeToResult (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeToResult.js:7:45)
    at MergeMapSubscriber._innerSub (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:132:38)
    at MergeMapSubscriber._tryNext (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:129:14)
    at MergeMapSubscriber._next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:112:18)
    at MergeMapSubscriber.Subscriber.next (/usr/lib/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:103:18)


FUCK IT!!
 To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
     echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
     sudo apt-get update && sudo apt-get install yarn

sudo apt-get update && sudo apt-get install yarn


https://docs.npmjs.com/getting-started/fixing-npm-permissions

https://www.npmjs.com/package/npx

sudo npm install -g npx
/usr/bin/npx -> /usr/lib/node_modules/npx/index.js
+ npx@10.2.0
added 484 packages in 23.161s


npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

https://github.com/angular/angular-cli/issues/2161

npm install -g -f angular-cli
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated angular-cli@1.0.0-beta.28.3: angular-cli has been renamed to @angular/cli. Please update your dependencies.
npm WARN deprecated exists-sync@0.0.3: Please replace with usage of fs.existsSync
npm WARN deprecated gulp-util@3.0.7: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN checkPermissions Missing write access to /usr/lib/node_modules
npm WARN @angular/core@2.4.10 requires a peer of rxjs@^5.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: asap@2.0.6 (node_modules/angular-cli/node_modules/asap):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@1.2.0 (node_modules/angular-cli/node_modules/@angular-cli/ast-tools/node_modules/minimist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: minimist@0.0.8 (node_modules/angular-cli/node_modules/@angular-cli/ast-tools/node_modules/mkdirp/node_modules/minimist):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: mkdirp@0.5.1 (node_modules/angular-cli/node_modules/@angular-cli/ast-tools/node_modules/mkdirp):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: source-map@0.5.6 (node_modules/angular-cli/node_modules/@angular-cli/ast-tools/node_modules/source-map):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: source-map-support@0.4.11 (node_modules/angular-cli/node_modules/@angular-cli/ast-tools/node_modules/source-map-support):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'

npm ERR! path /usr/lib/node_modules/.staging
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm ERR!  { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/.staging'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'mkdir',
npm ERR!      path: '/usr/lib/node_modules/.staging' },
npm ERR!   stack: 'Error: EACCES: permission denied, mkdir \'/usr/lib/node_modules/.staging\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: '/usr/lib/node_modules/.staging',
npm ERR!   parent: 'webpack-sources' }
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/programmer/.npm/_logs/2018-05-08T10_39_22_250Z-debug.log


yarn global add angular-cli.
yarn global v1.6.0
[1/4] Resolving packages...
error Couldn't find package "angular-cli." on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

No comments:

Post a Comment