【发布时间】: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