【问题标题】:I'm trying to installing react app using this command我正在尝试使用此命令安装反应应用程序
【发布时间】:2021-08-30 07:09:32
【问题描述】:

npm install -g create-react-app

然后我得到这样的错误:

npm ERR! code EPERM

npm ERR! syscall mkdir

npm ERR! path C:\Windows\system32\node_modules

npm ERR! errno -4048

npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\node_modules'

npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\Windows\system32\node_modules'] {

npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Windows\system32\node_modules'] {

npm ERR! errno: -4048,

npm ERR! code: 'EPERM',

npm ERR! syscall: 'mkdir',

npm ERR! path: 'C:\\Windows\\system32\\node_modules'

npm ERR! },

npm ERR! errno: -4048,

npm ERR! code: 'EPERM',

npm ERR! syscall: 'mkdir',

npm ERR! path: 'C:\\Windows\\system32\\node_modules',

npm ERR! parent: 'create-react-app'

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\Lagnajeet Jena\AppData\Roaming\npm-cache\_logs\2021-08-30T06_59_34_073Z-debug.log

【问题讨论】:

  • -g 是全局安装包。你不想在这里。按照 react js 的文档安装, npx create-react-app my-app 并确保你的终端有权限或者使用 sudo su
  • 但是这个 npx create-react-app my-app 也显示了一些错误

标签: node.js reactjs npm npm-install


【解决方案1】:

您的 npm 安装是系统范围的,这意味着您必须以 admin/root 身份运行您的 cmd/终端才能在 npm 安装上使用 -g 标志。您也可以将 node.js/npm 重新安装到您的用户目录中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多