Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ikilled opened this issue Dec 20, 2016 · 3 comments

Comments

@ikilled
Copy link

ikilled commented Dec 20, 2016

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
@celliott181
Copy link
Contributor

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).

@filipesilva
Copy link
Contributor

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants