Npm Yo生成器:不允许在.config上执行EPERM操作

Npm Yo生成器:不允许在.config上执行EPERM操作,npm,yeoman,yeoman-generator,Npm,Yeoman,Yeoman Generator,试图启动yo生成的项目并遇到以下错误(在osx上运行): 错误:EPERM,不允许操作'/Users/.config' 在Object.fs.mkdirSync(fs.js:642:18) 同步时(/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:70:13) 在Function.sync(/usr/local/lib/node_modules/yo/node_modules/

试图启动yo生成的项目并遇到以下错误(在osx上运行):

错误:EPERM,不允许操作'/Users/.config'
在Object.fs.mkdirSync(fs.js:642:18)
同步时(/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:70:13)
在Function.sync(/usr/local/lib/node_modules/yo/node_modules/configstore/node_modules/mkdirp/index.js:76:24)
在Object.create.all.get(/usr/local/lib/node_modules/yo/node_modules/configstore/index.js:41:13)
在Object.Configstore(/usr/local/lib/node_modules/yo/node_modules/Configstore/index.js:27:44)
在new Insight(/usr/local/lib/node_modules/yo/node_modules/Insight/lib/index.js:26:34)
反对。(/usr/local/lib/node_modules/yo/cli.js:123:15)
在模块处编译(Module.js:456:26)
在Object.Module.\u extensions..js(Module.js:474:10)
在Module.load(Module.js:356:32)
我知道这是一个权限错误,如果我能找到发生权限错误的.config目录,就不会有这样的问题。我打开了隐藏文件,但在任何地方都看不到.config。我确实尝试过更改节点_modules/configstore上的权限,正如我在使用yo时看到的关于EPERM错误的目录引用,但没有效果


任何见解都将不胜感激

在其他人遇到此问题的情况下,我的问题是文件夹被“锁定”。要解决此问题,请右键单击/ctrl+单击您的用户文件夹并选择“获取信息”。在总副标题下,取消选择“锁定”


希望这能帮助其他遇到此问题的人。

在其他人遇到此问题的情况下,我的问题是文件夹被“锁定”。要解决此问题,请右键单击/ctrl+单击您的用户文件夹并选择“获取信息”。在总副标题下,取消选择“锁定”


希望这能帮助其他偶然发现该文件的人。

在windows中,您需要删除该文件的只读标志
(在我的例子中,文件位于C:\Users\Sanjay\AppData\Roaming\npm\node\u modules\yo\node\u modules\configstore)

在windows中,您需要删除文件的只读标志
(在我的案例中,文件位于C:\Users\Sanjay\AppData\Roaming\npm\node\u modules\yo\node\u modules\configstore)

我在Windows 10中遇到了类似的jhipster生成器问题,原因是在此之前,一个用于恢复源代码的命令jhipster崩溃并且没有正确完成

EPERM: operation not permitted, rename 'C:\Users\xxx\AppData\Local\insight-nodejs\Config\insight-generator-jhipster.json.2340439885' -> 'C:\Users\xxx\AppData\Local\insight-nodejs\Config\insight-generator-jhipster.json'

因此,我右键单击文件夹“C:\Users\xxx\AppData\Local\insight nodejs\Config”->取消选中“只读”属性,然后确定->问题得到解决。

我在Windows 10中遇到了类似的jhipster生成器问题,原因是在此之前,一个用于恢复源代码的命令jhipster崩溃并且没有正确完成

EPERM: operation not permitted, rename 'C:\Users\xxx\AppData\Local\insight-nodejs\Config\insight-generator-jhipster.json.2340439885' -> 'C:\Users\xxx\AppData\Local\insight-nodejs\Config\insight-generator-jhipster.json'
因此,我右键单击文件夹“C:\Users\xxx\AppData\Local\insight nodejs\Config”->取消选中“只读”属性,然后单击OK->问题得到解决