nvm(节点版本管理器)用户经常在 VS Code 的集成终端中第一次看到这个错误:
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `nvm use --delete-prefix v8.12.0 --silent` to unset it
Run Code Online (Sandbox Code Playgroud)
根据这里的解决方案:https : //github.com/Microsoft/vscode-docs/blob/master/docs/editor/integrated-terminal.md#why-is-nvm-complaining-about-a-prefix-option-集成终端何时启动
我必须先找到旧的 npm 安装路径,然后在它之前运行“which npm”。
但是nvm初始化脚本在哪里以及如何在它之前运行“which npm”,只需在脚本开头添加一行?有没有其他方法可以解决这个问题?
这是我的代码:
#include <iostream>
#include <cmath>
int main() {
std::cout << std::sqrt(4) << std::endl;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
MAC操作系统10.15,CMake 3.15.4
只要包含头文件cmath.h,CMake编译就会出错。
执行命令:
cmake --build /Users/xxx/Documents/Playground/test1/cmake-build-debug --target test1 -- -j 4
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake --build /Users/xxx/Documents/Playground/test/cmake-build-debug --target test -- -j 4
Scanning dependencies of target test
[ 50%] Building CXX object CMakeFiles/test.dir/main.cpp.o
In file included from /Users/xxx/Documents/Playground/test/main.cpp:2:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:314:9: error: no member named 'signbit' in the global namespace
using ::signbit;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:315:9: error: no member named 'fpclassify' in the global namespace
using ::fpclassify;
~~^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:316:9: …Run Code Online (Sandbox Code Playgroud)