angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Instructions for Global History Installation from README.md may lead to "EPERM: operation not permitted..." error

Open ikilled opened this issue 9 years ago • 3 comments

Following the instructions under "Global Library Installation" from https://github.com/angular/angular-cli#global-library-installation to install bootstrap may lead to an EPERM error. The instructions is implicity say that is fine to have ng serve running while executing npm install bootstrap@next:

Restart ng serve if you're running it, and Bootstrap 4 should be working on your app.

I think it shouldn't say restart - The instructions should say that before running the npm install bootstrap@next command make sure that all instances of ng serve command are stopped.

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.22-1
node: 6.9.1
os: win32 x64

Repro steps.

run ng serve for your Angular2 project. Add Bootstrap 4 by executing the command from example in README.md in your Angular2 project folder: npm install bootstrap@next

The log given by the failure.

$ npm install bootstrap@next
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN [email protected] requires a peer of @angular/core@~2.1.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/common@~2.1.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/compiler@~2.1.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/platform-browser@~2.1.0 but none was installed.
npm WARN [email protected] requires a peer of @angular/router@~3.1.0 but none was installed.
npm WARN [email protected] requires a peer of tslint@^3.0.0 but none was installed.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "bootstrap@next"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! path C:\my_ng2_project\node_modules\bootstrap
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename

npm ERR! Error: EPERM: operation not permitted, rename 'C:\my_ng2_project\node_modules\bootstrap' -> 'C:\my_ng2_project\node_modules\.bootstrap.DELETE'
npm ERR!     at moveAway (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\my_ng2_project\node_modules\bootstrap' -> 'C:\my_ng2_project\node_modules\.bootstrap.DELETE'
npm ERR!     at Error (native)
npm ERR!  { Error: EPERM: operation not permitted, rename 'C:\my_ng2_project\node_modules\bootstrap' -> 'C:\my_ng2_project\node_modules\.bootstrap.DELETE'
npm ERR!     at moveAway (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:38:5)
npm ERR!     at destStatted (C:\Program Files\nodejs\node_modules\npm\lib\install\action\finalize.js:27:7)
npm ERR!     at FSReqWrap.oncomplete (fs.js:123:15)
npm ERR!
npm ERR! Error: EPERM: operation not permitted, rename 'C:\my_ng2_project\node_modules\bootstrap' -> 'C:\my_ng2_project\node_modules\.bootstrap.DELETE'
npm ERR!     at Error (native) parent: 'my-ng2-project' }
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!     C:\my_ng2_project\npm-debug.log

ikilled avatar Dec 20 '16 11:12 ikilled

If you installed with an elevated (Admin, sudo, whatever) prompt, uninstall the CLI, nuke node_modules and the app folder, then reinstall as a standard user. This will fix the permission errors. After that, run ng commands with an elevated prompt to avoid a performance hit (Supposedly fixed, I still see it).

celliott181 avatar Dec 20 '16 13:12 celliott181

It's true that changing files might interfere with processes still using them, but that's true of... computering in general I guess.

In your specific case it seemed like you already had bootstrap installed and were reinstalling it:

Error: EPERM: operation not permitted, rename 'C:\my_ng2_project\node_modules\bootstrap' -> 'C:\my_ng2_project\node_modules\.bootstrap.DELETE'

I guess it can happen from time to time, but it doesn't sound noteworthy enough to make a special note of it.

filipesilva avatar Dec 30 '16 16:12 filipesilva

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.