Skip to content

bash: ng: command not found #9155

@ariklu

Description

@ariklu

Versions

Windows 10
node 8.9.4
npm 5.6.0

Repro steps

Observed behavior

  1. few warning during npm instal
    ...
    ...
    Binary found at C:\Users\XXX\angular\node_modules\node-sass\vendor\win32-x64-57\binding.node
    Testing binary
    Binary is fine
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\f sevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevent s@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x 64"})
    added 1069 packages in 708.822s

  2. $ npm install -g @angular/cli
    npm WARN rollback Rolling back @angular/cli@1.6.3 failed (this is probably harmless): EPERM: opera tion not permitted, unlink 'C:\Users\aluft\AppData\Roaming\npm\node_modules@angular\cli\node_modu les'
    npm ERR! path C:\Users\aluft\AppData\Roaming\npm\node_modules@angular\cli
    npm ERR! code EPERM
    npm ERR! errno -4048
    npm ERR! syscall rename
    npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\node_mo dules@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules@angular.cli.DELETE'
    npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\node _modules@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules@angular.cli.DELETE'
    npm ERR! cause:
    npm ERR! { Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roaming\npm\no de_modules@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules@angular.cli.DELETE'
    npm ERR! errno: -4048,
    npm ERR! code: 'EPERM',
    npm ERR! syscall: 'rename',
    npm ERR! path: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli',
    npm ERR! dest: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\.cli.DELETE' },
    npm ERR! stack: 'Error: EPERM: operation not permitted, rename 'C:\Users\aluft\AppData\Roam ing\npm\node_modules\@angular\cli' -> 'C:\Users\aluft\AppData\Roaming\npm\node_modules \@angular\.cli.DELETE'',
    npm ERR! errno: -4048,
    npm ERR! code: 'EPERM',
    npm ERR! syscall: 'rename',
    npm ERR! path: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\cli',
    npm ERR! dest: 'C:\Users\aluft\AppData\Roaming\npm\node_modules\@angular\.cli.DELETE' }
    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! C:\Users\aluft\AppData\Roaming\npm-cache_logs\2018-01-10T11_26_42_505Z-debug.log

Desired behavior

working angular cli (ng -v ; ng serve etc.)

Mention any other details that might be useful (optional)

Worked just fine till last week (don't remember versions),
when I tried to install nvm for managing nvm versions.

Tryed to resolve this issue by (nothing helped):

  • re-installing node
  • deleting node_modules and re-installing them
  • npm cache verify
  • npm cache clean

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions