问题
I know this is a common error with node
but all my troubleshooting techniques seem to be failing.
- Windows 7 (32-bit)
- Node@0.10.10
- npm@1.2.25
This issue occurs when trying to run package commands like bower
and yo
(Yeoman). For my sanity, I am in a Node.js command prompt running as an Administrator when executing these commands.
For example, here is the output for running this with yo
:
Error: EPERM, operation not permitted 'C:\Users\me\.config\configstore\insight-yo.yml'
at Object.fs.openSync (fs.js:427:18)
at Object.fs.writeFileSync (fs.js:966:15)
at Object.create.all.set (C:\Users\me\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\configstore\configstore.js:39:7)
at Object.Configstore (C:\Users\me\AppData\Roaming\npm\node_modules\yo\node_modules\insight\node_modules\configstore\configstore.js:30:11)
at new Insight (C:\Users\me\AppData\Roaming\npm\node_modules\yo\node_modules\insight\lib\insight.js:20:16)
at Object.<anonymous (C:\Users\me\AppData\Roaming\npm\node_modules\yo\bin\yo:25:15)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
Essentially, it seems the node
process can't write to this .config
folder.
I've tried the following to troubleshoot:
- Fresh installs of
node
and the individual packages (in every conceivable order) - Setting write privileges for all users on the
.config
folder - Reinstalling
git
after reading the notes for Windows users in the npm repository
Any thoughts or troubleshooting techniques on this issue?
Thanks!
回答1:
I solved the problem by just deleting the file at C:\Users\<your username>\.config\configstore\insight-bower.yml
, bower will recreate it upon running.
回答2:
It worked for me to delete the .yml file inside the configstore which was causing the problem. In my case it was "update-notifier-bower.yml", in yours it is probably "insight-yo.yml".
After a reinstallation of bower (npm -g install bower) the file reappeared, but this time it caused no harm.
It has also been reported that the deactivation of the anti-virus software solved the issue.
回答3:
For me there were three files at C:\Users\myusername\.config\configstore
(bower-github.yml, insight-bower.json, update-notifier-bower.yml) delted all three
Also disabled the antivirus.
Note: Don't forget to show hidden files.
回答4:
Just change windows rights for "all users" onto the "configstore" directory and bower will correctly install the package
回答5:
I was getting this error when running Yeoman generators on Windows. McAfee real-time scanning was preventing file system changes. Setting the real-time scanning to "Programs and documents only" worked for me.
回答6:
For me navigating to the file with the File Explorer caused a pop up to appear which granted me permission to access the file.
After that nodemon
ran without problems.
回答7:
running npm cache clean --force
helped me.
npm cache clean
by itself with node 5+ gives this warning:
npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. npm ERR! npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force.
NPM cache documentation.
Note: my real problem was the package-lock.json file. I had done some things locally and thought they were removed, but got to the build agent and got this error. It would probably help to delete the node_modules folder and do a fresh npm install
.
来源:https://stackoverflow.com/questions/16989013/eperm-operation-not-permitted-error-config-store