Turn off the options shown in the figure
Tag Archives: vscode
VScode jsconfig.json files First Line error for no reasons
Error reporting:
analysis
Vscode will automatically check the semantics of JavaScript files. Because of the custom jsconfig The JSON file cannot overwrite the configuration of vscode, so an error will be reported.
Solution:
Open the configuration settings.json file and let the custom jsconfig.js file override the vscode default options.
VScode Run CONDA environment Error [How to Solve]
In the CONDA environment using vs code, running the program will report the following problems
conda activate base
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
If using 'conda activate' from a batch script, change your
invocation to 'CALL conda.bat activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- cmd.exe
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
After online search, the solution is as follows. Method 2 can be used for pro test:
Method 1:
Use the anaconda navigator or Anaconda PowerShell prompt provided by Anaconda to enter the environment, or enter CONDA Bat activate “environment path”, such as CONDA batactivate”D:\Anaconda3\envs\test”
Method 2:
Step 1:
Open the administrator power shell, modify the execution policy, execute: get executionpolicy, reply restricted, indicating that the status is prohibited
Restricted – default setting, no scripts are allowed to run
allsigned – only scripts signed by digital certificates can be run
remotesigned – local scripts do not need digital signatures, but scripts downloaded from the network must have digital signatures
unrestricted – all scripts are allowed to run
Step 2:
Execute: set executionpolicy remotesigned
Step 3:
Input: CONDA init
At this time, the configuration file profile will be generated under C:\users\XXX\documents\windowspowershell ps1
After restarting the power shell or vs code, it will enter the base environment of CONDA by default
Recovery:
Delete profile ps1.
According to personal conditions, execute the set executionpolicy restricted policy and change it back to restricted.
Vs code execute command error [How to Solve]
Inexplicable mistake about vs Code
Error Description:
Drive not found. If you enter any execution command in the vs Code terminal, you will report “drive not found”. The name is’ ‘ The drive for ‘C’ does not exist.
Solution:
-
- download the cmder plug-in in vs Code
-
- modify the default terminal
-
- steps: File —— preferences —— settings —— search shell —— Click to enter the file
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe"
Note out and replace with:
"terminal.integrated.shell.windows": "cmd.exe",
"terminal.integrated.env.windows": {"CMDER_ROOT": "[cmder_root]"},
"terminal.integrated.shellArgs.windows": ["/k", "[cmder_root]\\vendor\\init.bat"],
As shown in the figure:
4 Save exit, restart vs Code
How to Solve Vscode terminal error (ts -v)
Solution: (test available)
run PowerShell as an administrator and execute the command set-ExecutionPolicy RemoteSigned
to change the execution policy of PowerShell
to RemoteSigned
1. Win + X: select windows PowerShell to open the shell
2. Run set-ExecutionPolicy RemoteSigned
command and enter y
3. Run get-ExecutionPolicy
command to see that the execution policy of the script has been changed to RemoteSigned
4. Return to the vscode terminal and enter the command TSC – V to stop reporting errors, TS files can also be compiled
VScode integrate terminal input node error [How to Solve]
At the beginning, an error is reported when NPM install XXX is entered in vscode:
NPM: the ‘NPM’ entry cannot be recognized as the name of a cmdlet, function, script file, or runnable program. Check the spelling of the name. If you include a path, make sure the path is correct, and then try again
location line: 1 character: 1
+ NPM install unip
+ ~ ~
+ categoryinfo: objectnotfound: (NPM: String) [], commandnotfoundexception
+ fullyqualified errorid: commandnotfoundexception
After that, I input node – V and NPM – V on CMD, which are not internal commands. Then I input node on windows PowerShell to execute. Then I checked the environment variables and found that I used node The installation directory of JS was moved, but the path of the environment variable was not modified. After the modification, everything was normal, but the vscode integration terminal still didn’t work. I checked a lot of data.
Solution:
Right click the vscode icon – properties – compatibility – run as administrator
VScode: How to Solve golong plug-in install Error
An error is reported when installing the go plug-in for vscode under Windows:
...
Installing golang.org/x/tools/gopls@latest FAILED
{
"killed": false,
"code": 1,
"signal": null,
"cmd": "D:\\Program Files\\Go\\bin\\go.exe install -v golang.org/x/tools/gopls@latest",
"stdout": "",
"stderr": "go install: golang.org/x/tools/gopls@latest: module golang.org/x/tools/gopls: Get \"https:///goproxy.cn/golang.org/x/tools/gopls/@v/list\": http: no Host in request URL\n"
}
...
Most people can’t go to GitHub, but I can go up here. The report here is no host
after a lot of queries, it is found that most of them are agents, and then go to GitHub to download them, and then execute them. I still report an error after downloading
the solution is recorded here.
Method 1: update the environment variable and configure the download agent address
Or open PowerShell and enter:
$env:GO111MODULE="on"
$env:GOPROXY="https://goproxy.io"
go env -w GOPROXY=https://goproxy.cn,direct
//go env -w GOPROXY=https://goproxy.io,direct
go env -w GOPRIVATE=*.corp.example.com
goproxy.IO and goproxy.Cn is OK
Executing the following command in the terminal will output go Evn configuration
go env
set GO111MODULE=on
set GOARCH=amd64
set GOBIN=D:\Program Files\Go\bin
set GOCACHE=C:\Users\admin\AppData\Local\go-build
set GOENV=C:\Users\admin\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=D:\server\GO\pkg\mod
set GONOPROXY=*.corp.example.com
set GONOSUMDB=*.corp.example.com
set GOOS=windows
set GOPATH=D:\server\GO
set GOPRIVATE=*.corp.example.com
set GOPROXY=https://goproxy.io
set GOROOT=D:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.17.5
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=NUL
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\admin\AppData\Local\Temp\go-build957788953=/tmp/go-build -gno-record-gcc-switches
Note that gopath is the dependent package directory of go, and goroot is the installation directory of go
If it is executed in the vscode terminal, the update will not be seen until the terminal is closed and then output. Only restart the vscode terminal, and the configuration displayed here will not change!
Then, Ctrl + Shift + P in vscode to call up the search term, enter go install, select go: Install/update tools, and then select all to execute
Here I see that many people have successfully implemented it, but I don’t think it will work.
Method 2: manually download the plug-in project (clone)
Create a folder in the% gopath% Directory:
Src/golang org/x/
Open the terminal and switch to% gopath%/SRC/golang Under org/X/directory, execute clone:
cd $env:GOPATH/src/golang.org/x/
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/lint.git
My% gopath% directory is D:\server\go, and the current directory is as follows:
Then switch to% gopath%\SRC\golang. In the terminal Org\x\
go install -v golang.org/x/tools/gopls
But I still failed here. Hint:
PS D:\server\GO\src> go install -v golang.org/x/tools/gopls
go install: version is required when current directory is not in a module
Try 'go install golang.org/x/tools/gopls@latest' to install the latest version
After adding the @latest version, the installation succeeded:
PS D:\server\GO\src> go install -v golang.org/x/tools/gopls@latest
...
PS D:\server\GO\src> go install -v github.com/haya14busa/goplay/cmd/goplay@latest
...
PS D:\server\GO\src> go install -v github.com/go-delve/delve/cmd/dlv@latest
...
PS D:\server\GO\src> go install -v github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest
PS D:\server\GO\src> go install -v github.com/cweill/gotests/gotests@latest
PS D:\server\GO\src> go install -v github.com/fatih/gomodifytags@latest
PS D:\server\GO\src> go install -v github.com/josharian/impl@latest
PS D:\server\GO\src> go install -v github.com/haya14busa/goplay/cmd/goplay@latest
In front of this is the directory used, followed by GitHub COM, because my local error is vs automatic installation, I reported both addresses, so I tried to install both
above.
How to Solve VScode 2022 error: msvcp110d.dll not found
Recently, I’m using vs 2022 for development. Record the solutions that msvcp110d.dll can’t find.
Method 1: in the project -> Attribute -> c/c++ -> Code generation -> Modify to multithreaded debugging (MDD) at runtime
The reason for the error is that the msvcp110d.dll library is missing when compiling the dynamic library. The VC library used by the incompatible version of VS is different
Method 2: Download vcredist from the official website_X64.exe and vcredist_ X86.exe installation (valid for release only)
Method 3: Download msvcp110d.dllmsvcp110d.dll
Save the downloaded DLL file in the system directory: C: Windows\system32 C:Windows\syswow64 (my system is win10) and restart the computer
[Solved] Vscode connect virtual machine error: can’t be established
Record a problem with the vscode connection virtual machine
There is no problem when using vscode to connect the virtual machine for the first time
when returning to school to use campus network connection, set the virtual machine network to bridge mode
after obtaining IP, an error is reported when using vscode to connect:
The authenticity of host '192.168.1.106 (192.168.1.106)' can't be established.
Tried to use the command and modify the sshconfig file
SSH – O stricthostkeychecking = no 192.168.0.xxx
Stricthostkeychecking no
userknownhostsfile/dev/null
results are not allowed
the final solution is
Add “remote.SSH.Uselocalserver” on the last side: true
Vscode uses /deep/ Syntax error [How to Solve]
Use/deep/to report syntax errors in vscode and report them in red
When pulling other people’s items, you will encounter/deep/reporting syntax errors in vscode, but the items can run and we can’t modify them. The problem can be solved by modifying the configuration file of vscode
CSS> Lint: empty rules
then there is no red wavy line and no error is reported
Uncaught Error: Unrecognized datatype for attribute “news.news_date“
Change datetisse to date
Serialize does not support datetisse
error: #error PCL requires C++14 or above [Solved]
Running a file with a PCL library reports an error #error PCL requires C + + 14 or above
Solution: find all PCL dependent function packages in the project and change their corresponding cmakelists.txt file
For specific modification methods, see
add_compile_options(-std=c++11)
Add a line of code to this line of code
set(CMAKE_CXX_STANDARD 14)
As shown in the figure