我完全是React JS的初学者。使用此命令npm install --save-dev tachyons@4.10.0
安装名为“ Tachyons”的软件包后,在react项目中使用此命令npm start
启动npm时,我一直收到此错误。但问题是-在安装软件包之前一切正常。我不知道怎么了希望有人能帮助我。谢谢。
npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor.
npm WARN deprecated kleur@2.0.2: Please upgrade to kleur@3 or migrate to 'ansi-colors' if you prefer the old syntax. Visit <https://github.com/lukeed/kleur/releases/tag/v3.0.0\> for migration path(s).
npm WARN rollback Rolling back @types/node@11.9.5 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\User\Desktop\robofriends\node_modules\@types\node'
npm WARN ts-pnp@1.0.1 requires a peer of typescript@* but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\Users\User\Desktop\robofriends\node_modules\@types
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall mkdir
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\User\Desktop\robofriends\node_modules\@types'
npm ERR! { [Error: EPERM: operation not permitted, mkdir 'C:\Users\User\Desktop\robofriends\node_modules\@types']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, mkdir 'C:\Users\User\Desktop\robofriends\node_modules\@types'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path:
npm ERR! 'C:\\Users\\User\\Desktop\\robofriends\\node_modules\\@types' },
npm ERR! stack:
npm ERR! "Error: EPERM: operation not permitted, mkdir 'C:\\Users\\User\\Desktop\\robofriends\\node_modules\\@types'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path:
npm ERR! 'C:\\Users\\User\\Desktop\\robofriends\\node_modules\\@types',
npm ERR! parent: 'robofriends' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-02-24T22_26_47_036Z-debug.log
答案 0 :(得分:0)
实际上,关于出现错误的可能原因,您的日志非常清楚...
该操作被您的操作系统拒绝。 npm ERR!该文件可能已被使用(通过文本编辑器或防病毒软件), npm ERR!或者您没有访问权限。
您是否打开了另一个终端?
如果您认为这可能是权限问题,请仔细检查 npm ERR!文件及其包含目录的权限,或尝试运行 npm ERR!再次以root / Administrator身份执行命令(尽管不建议这样做)。
以管理员身份运行命令提示符。
除上述内容外,日志的前4行会向您发出警告,您应始终避免使用旧版本的软件包或未积极维护的软件包。