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

"npm install -g @vue/cli" command raising problems #839

Closed
LLIAMAH opened this issue Feb 3, 2021 · 4 comments
Closed

"npm install -g @vue/cli" command raising problems #839

LLIAMAH opened this issue Feb 3, 2021 · 4 comments

Comments

@LLIAMAH
Copy link

LLIAMAH commented Feb 3, 2021

Win10 x64 command just breaks in process. REQUIRED ADMIN priveledges to run.

ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'
npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'] {
npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\Program Files\nodejs\node_modules\.staging',
npm ERR! parent: '@babel/core'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\User\AppData\Roaming\npm-cache_logs\2021-02-03T08_07_20_266Z-debug.log

//==============================================================================
Records from log:

16535 verbose unlock done using C:\Users\User\AppData\Roaming\npm-cache_locks\staging-dfd8fbf9c1feea0f.lock for C:\Program Files\nodejs\node_modules.staging
16536 timing stage:rollbackFailedOptional Completed in 1ms
16537 timing stage:runTopLevelLifecycles Completed in 83514ms
16538 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules@vue\cli\node_modules\chokidar\node_modules\fsevents):
16539 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
16540 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
16540 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
16540 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
16540 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
16541 warn @vue/compiler-sfc@3.0.5 requires a peer of vue@3.0.5 but none is installed. You must install peer dependencies yourself.
16542 verbose stack Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'
16543 verbose cwd C:\Users\User\Documents\Visual Studio Code\exp-vue
16544 verbose Windows_NT 10.0.19041
16545 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "-g" "@vue/cli"
16546 verbose node v15.6.0
16547 verbose npm v6.14.11
16548 error code EPERM
16549 error syscall mkdir
16550 error path C:\Program Files\nodejs\node_modules.staging
16551 error errno -4048
16552 error Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'
16552 error [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'] {
16552 error cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'] {
16552 error errno: -4048,
16552 error code: 'EPERM',
16552 error syscall: 'mkdir',
16552 error path: 'C:\Program Files\nodejs\node_modules\.staging'
16552 error },
16552 error errno: -4048,
16552 error code: 'EPERM',
16552 error syscall: 'mkdir',
16552 error path: 'C:\Program Files\nodejs\node_modules\.staging',
16552 error parent: '@babel/core'
16552 error }
16553 error The operation was rejected by your operating system.
16553 error It's possible that the file was already in use (by a text editor or antivirus),
16553 error or that you lack permissions to access it.
16553 error
16553 error If you believe this might be a permissions issue, please double-check the
16553 error permissions of the file and its containing directories, or try running
16553 error the command again as root/Administrator.
16554 verbose exit [ -4048, true

@NataliaTepluhina
Copy link
Member

I don't think this issue is related to docs repository. Could you please create one on vue-cli repo

@LinusBorg
Copy link
Member

It's not related to Vue CLI either. it's realted to the OPs local user priviliges. Likely node was installed with admin privileges, but run without them.

@LLIAMAH
Copy link
Author

LLIAMAH commented Feb 3, 2021

Do I understanding right: to install @vue/cli solution globally - I must RUN some commands under Admin privileges and it is NOT problem of the of vue cli?

Nodejs - installs with special permission requests - it is normally. It has installer (ion Win) requests them, and user could agree or disagree and continue or reject process.
@angular/cli solution installs globally without problem.
reactjs solution installs without admin privileges too....

but @vue/cli - need some special rights to installs?
Guys, I'm new in front-end development, but... I guess it is bad nuance to choose this solution to start with it.

@LinusBorg
Copy link
Member

LinusBorg commented Feb 3, 2021

Do I understanding right: to install @vue/cli solution globally - I must RUN some commands under Admin privileges and it is NOT problem of the of vue cli?

No, that's not what I was trying to say.

Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules.staging'

that means: the npm process is not allowed to create a folder in this path.

That's an issue of your npm installation, in one way or another. The vue cli package can't tell npm where to copy files, where to create files or folders etc.

As you can see from the error message further down, it was attempting to create a folder as a child folder ob @babel/core and failed.

usually, these kinds o problems happen when npm was installed by a user with admin privileges, which often creates problems when installing global packages with a non-admin user, which is what I was referring to, but there can be other reasons as well, I guess.

For example, according to this old npm issue, cleaning npm's cache often resolves the issue, maybe try that:

npm/npm#10826

npm itself provides the following things when access/perm errors for global packages are encountered:

https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally

Similar problems can also happen with angular-cli and all kinds of other packages, found this with a quick google:

https://stackoverflow.com/questions/42985208/angular-cli-ng-new-error-eperm-operation-not-permitted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants