Node.js官网、常用工具、开发教程和常见问题
中文网:https://www.nodejs.com.cn/
常用工具
开发教程
常见问题
1、nanopop@2.4.0: The engine "node" is incompatible with this module. Expected version "^20". Got "16.20.2"。
使用nvm工具切换对应的版本,例如:
nvm use 20
方法2,执行以下代码即可:
yarn config set ignore-engines true
2、node-gyp可以不依赖 Visual Studio 吗?
可以的,执行以下命令安装windows-build-tools。
npm install -g windows-build-tools
这时,可能会报这样一个错误:Downloading installers failed. Error: TypeError: 'process.env' only accepts a configurable, writable, and enumerable data descriptor。
打开目录 C:\Users\用户名\.windows-build-tools ,安装 vs_BuildTools.exe 即可。(Visual Studio 15 生成工具 2017)
3、"Visual Studio C++ core features" missing。
安装Visual Studio 15 生成工具 2017时,没有选中 Visual C++生成工具。
4、msvs_version does not match this version. could not find a version of Visual Studio 2017 or newer to use.
执行以下代码即可。
yarn config set msvs_version 2017
5、`msvs_version` is not a valid npm option
npm版本问题,手工编辑 C:\Users\liteng\.npmrc 即可。