Super strange thing just happened. In the middle of my project running, it crashed and I was left with this error:
Error: EPERM: operation not permitted, uv_cwd
at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
...
All of the files on the lefthand side of the editor disappeared. Was just weird, so I closed VS Code and navigated to the folder and used the code . shell command to open it up again as I normally would; however, this error again.
It literally came out of nowhere - I ran my program, got up to grab my coffee, came back 2 minutes later and was left with this. I have already tried:
Uninstalling and reinstalling VS Code
Running npm cache clean with the --force flag.
No luck though. Anyone have any ideas? I can't find anything online.
Edit:
It's happening again. I'm once again trying to run code . within a project's directory in order to open it in VSCode. Here's the error's full stack trace:
Error: EPERM: operation not permitted, uv_cwd
at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:126:28)
at setupCurrentWorkingDirectory (/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-node.js:1:155)
at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-node.js:1:260)
at Module._compile (node:internal/modules/cjs/loader:1163:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1216:10)
at Module.load (node:internal/modules/cjs/loader:1035:32)
at Module._load (node:internal/modules/cjs/loader:876:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Module.require (node:internal/modules/cjs/loader:1059:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Applications/Visual Studio Code.app/Contents/Resources/app/out/cli.js:1:97)
at Module._compile (node:internal/modules/cjs/loader:1163:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1216:10)
at Module.load (node:internal/modules/cjs/loader:1035:32)
at Module._load (node:internal/modules/cjs/loader:876:12)
at Function.c._load (node:electron/js2c/asar_bundle:5:13343)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
errno: -1,
code: 'EPERM',
syscall: 'uv_cwd'
}
The project's folder (foo-bar) lives in a folder called (let's say) FizzBuzz on my desktop. From my desktop, I can run code FizzBuzz/foo-bar and it'll open the project just file. The error above occurs when I try to run cd FizzBuzz/foo-bar && code .
It's a long shot, but since you're probably using MacOS, it could very well be related to an anti virus. Seems plausible for your case as it's coming completely out of the blue.
If you use && in bash, it spawns the process in a different way than using code . standalone. So it's possibly flagged as dangerous only with && by anti virus, which might explain the difference you're observing in your edit.
Keep in mind that there is a chance you actually have a malicious package installed and it's rightly being picked up. A small chance, but malicious packages do exist on NPM. These recent discoveries might also have resulted in more anti virus rules and scanning of JS packages, which in turn make false positives more likely.
On a similar question there are also reports of this as a cause.
If it's not related to that, the question has plenty other answers you can try.
You didn't mention whether you tried rebooting. Since you updated the question saying "it's back", I assume it just stopped occurring previously. When did it do so? Was if after a reboot?
I had a similar issue recently but after winding about for a while I realized this; I was running the npm start command from the bin directory. This happens when you delete a very valuable file and somehow the package manager searches the bin for the file. To resolve this try to change the directory into your working folder and make sure you've got all the necessary files available ie the index.js etc. It should work from here on end.
Related
I am currently unable to open code-insiders (latest build) The interface loads and then immediately closes, however there are code-insider processes left behind still running in back ground that I have to kill directly. The error in the log is: /usr/share/code-insiders/code-insiders --unity-launch --enable-crashpad: symbol lookup error: /usr/share/code-insiders/resources/app/node_modules.asar.unpacked/vscode-encrypt/build/Release/vscode-encrypt-native.node: undefined symbol: SHA256_Init I have seen similar posts that point to the libcrypt and libssh libraries and I have tried re-installing both with no change. I have also purged code and reinstalled the latest build. This still occurs if I try and launch with extensions disabled.
Any suggestions on where to search next would be appreciated.
SHA256_Init crash problem is due to the vscode-encrypt-native ELF is not linked against lcrypto so the symbols cannot be resolved properly.
You can do a quick fix:
$ find /usr/lib/ -type f -name "libcrypto.so.*"
/usr/lib/x86_64-linux-gnu/libcrypto.so.1.1
$ sudo apt instal patchelf
$ sudo patchelf --add-needed libcrypto.so.1.1 /usr/share/code-insiders/resources/app/node_modules.asar.unpacked/vscode-encrypt/build/Release/vscode-encrypt-native.node
Ref: https://github.com/microsoft/vscode/issues/142656#issuecomment-1034173634
I'm trying to use the Heroku cli "keys" functions to upload a ssh key to my account. Unfortunately I run into the following error whenever I try to use any of the keys methods.
TypeError: Cannot read property 'run' of undefined
at Object.<anonymous> (C:\Users\Administrator\AppData\Local\heroku\tmp\heroku-script-292666295:14:4)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:456:32)
at tryModuleLoad (module.js:415:12)
at Function.Module._load (module.js:407:3)
at Function.Module.runMain (module.js:575:10)
at startup (node.js:159:18)
at node.js:444:3
Any thoughts would be greatly appreciated.
After speaking with the Heroku support team we found that heroku update fixed the problem.
It seems, Heroku command facing trouble finding right version of ruby so its throwing the error.
Uninstall Heroku Toolbelt through Windows "Control Panel\Programs and Features" after successful uninstallation, delete C:\Program Files\Heroku folder as well.
And then reinstall Heroku Toolbelt and try to run the command. It should work.
I removed this folder and all was well C:\Users\USERNAME.heroku.npm-cache
Updating your package.json with the Node version you are using may fix this:
"engines": {
"node": "6.0.0"
},
I was using version 6.0.0 locally, but Heroku was downloading version 5.11.1.
I solve this error unstalling node.js from windows and removing the content of heroku folder(in appdata), after that typed on the propty: heroku --version. heroku said me to update git to other version, I updated it. then I run the command to generate a key again and worked perfectly. This worked to me.
I tried to upgrade my babel from 6 to 7, but I encounter this issue.
/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:328
throw e;
^
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure you have a compatible version of #babel/core, it is likely that something in your build process is loading the wrong version. Inspect the stack trace of this error to look for the first entry that doesn't mention "#babel/core" or "babel-core" to see what is calling Babel. (While processing preset: "/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/lib/index.js")
at throwVersionError (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:65:11)
at Object.assertVersion (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:13:11)
at _default (/Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/lib/index.js:154:7)
at /Users/darryl/Documents/Github/apps/node_modules/#babel/preset-env/node_modules/#babel/helper-plugin-utils/lib/index.js:19:12
at /Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:317:46
at Array.map (<anonymous>)
at OptionManager.resolvePresets (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
at OptionManager.mergePresets (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
at OptionManager.mergeOptions (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
at OptionManager.init (/Users/darryl/Documents/Github/apps/node_modules/babel-register/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
at compile (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:103:45)
at loader (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:144:14)
at Object.require.extensions.(anonymous function) [as .js] (/Users/darryl/Documents/Github/apps/node_modules/babel-register/lib/node.js:154:7)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Can someone help to explain what had happened?
I tried to remove node_modules and package-lock.json, and also run npm cache clean --force
But this error still occured.
How to force this dependency (#babel/preset-env) to use Babel 7 in their dependency instead of Babel 6.26.3?
As mentioned by loganfsmyth, do
npm i -D #babel/register
help me to solve the issue I encounter about this babel-register dependency that still using Babel version 6.
I am trying to debug vscode source code from vscode itself. While I am trying to debug from the 'Launch VS Code' and press F5, it gives the following error.
Loading "winreg" failed
loader.js:224
Error: Cannot find module 'winreg'
loader.js:227
at Module._resolveFilename (module.js:470:15)
at Function.Module._resolveFilename (c:\Users\oguz\Documents\workspace\vscode\.build\electron\resources\electron.asar\common\reset-search-paths.js:35:12)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at nodeRequire (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1642:28)
at NodeScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:703:39)
at OnlyOnceScriptLoader.load (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:549:37)
at loadNextPath (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1401:41)
at Object.errorback (file:///C:/Users/oguz/Documents/workspace/vscode/out/vs/loader.js:1409:25)
Detail:
loader.js:225
Error: Cannot find module 'winreg'
loader.js:225
Here are the modules that depend on it:
Array(1) ["vs/platform/telemetry/node/workbenchCommonProperti…"]
I've found my own solution. Npm requires winreg module but it could not find it. So, I installed it manually by npm install winreg command. Now I can debug vscode.
https://www.npmjs.com/package/winreg
I am installing Redmine and I am getting crazy because of a rake problem. In particular, in order to perform a bundle install for the different Ruby's plugins, I have been asked to install xapian-full-alaveteli, v 1.2.9.5.
The problem is that I get the following error:
Building native extensions. This could take a while...
ERROR: Error installing xapian-full-alaveteli:
ERROR: Failed to build gem native extension.
/home/redmine/.rvm/rubies/ruby-2.2.0/bin/ruby -rubygems /home/redmine/.rvm/rubies/ruby-2.2.0/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake RUBYARCHDIR=/home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5 RUBYLIBDIR=/home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5
rake aborted!
NameError: uninitialized constant Config
/home/redmine/.rvm/gems/ruby-2.2.0/gems/xapian-full-alaveteli-1.2.9.5/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)
rake failed, exit code 1
Gem files will remain installed in /home/redmine/.rvm/gems/ruby-2.2.0/gems/xapian-full-alaveteli-1.2.9.5 for inspection.
Results logged to /home/redmine/.rvm/gems/ruby-2.2.0/extensions/x86_64-linux/2.2.0/xapian-full-alaveteli-1.2.9.5/gem_make.out
I've tried editing by hand the rakefile and removing the line that causes troubles, but it magically reappears. The documentation about the use of rake/gem is, imho, at least vague, therefore I am totally stuck -- with a server that was supposed to be in production two days ago...
Summary
Obsolete calls to Config can cause the error. Try changing
Config::CONFIG ====> RbConfig::CONFIG
In detail
Running a Gem's rakefile caused the error: uninitialized constant Config.
Googling suggests Config is obsolete and to replace it with RbConfig. RbConfig is in the latest Ruby though the document is blank and I cannot find a Config in Ruby.
Fixes replace Config with RbConfig: gettalong/kramdown and thoughtbot/cocaine. Which also worked in my case.
Conclusion
Replace Config::CONFIG with RbConfig::CONFIG