1. Problem description:
First, the overall error is:
the installation command is:npm i node-sass
npm ERR! code ETIMEDOUT
npm ERR! syscall connect
npm ERR! errno ETIMEDOUT
npm ERR! network request to https://registry.npmmirror.com/node-sass failed, reason: connect ETIMEDOUT 240e:e9:d804:0:3::3fb:443
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! network request to https://registry.npmmirror.com/node-sass failed, reason: connect ETIMEDOUT 240e:e9:d804:0:3::3fb:443
Chinese is:
npm 错误! 到 https://registry.npmmirror.com/node-sass 的网络请求失败,原因:连接 ETIMEDOUT 240e:e9:d804:0:3::3fb:443
Second, the problem is described as:
I want to vue3
support the language in the project <style lang="scss" scoped>
, so I want node-sass
and sass-loader
to achieve my goal, but an error is reported during the installation process;
Third, the error display is as follows:
2. Problem analysis:
First, according to the error message in Chinese:
According to the error message in Chinese, it is clear that it is a problem with the mirror image (that is, a problem with the connected network), which makes it impossible to access the node-sass
download address of ;
Second, the idea of solving the problem:
In general, there are only two solutions:
A. Switch to node-sass
the mirror address of download, etc.;
B. Use some instructions to enable node-sass
successful download;
3. Problem solving:
Method 1. Switch the downloaded mirror address:
A. The command to view the current address is:npm config get registry
B. The command to switch address is:npm config set registry http://registry.npm.taobao.com
C. The mirror address at this time is:http://registry.npm.taobao.com
D. Enter the command again npm i node-sass
, and the problem can generally be solved;
Method 2: Command to switch the downloaded node-sass
image address:
A. The download command is:
npm install node-sass --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
B. At this time, the problem can generally be solved;
Method 3. If the above two steps do not solve the problem, you can try to restart the computer:
At this time, enter the command again npm i node-sass
, and the problem can generally be solved;
[
Note: In vue3
the project of , because node
the version of is relatively high, node-sass
the version of is generally relatively high
, but sometimes sass
it may need to be installed because of the version of , sass
the command is:npm i sass
// The error message of sass is:
】
4. Summary:
First, where there is something wrong or inappropriate, please give me some pointers and exchanges!
Second, if you repost or quote the content of this article, please indicate the address of this blog https://blog.csdn.net/weixin_43405300
. Creation is not easy, but it can be done and cherished!
Third, if you are interested, you can pay more attention to this column (Vue (Vue2+Vue3) interview must-have column):https://blog.csdn.net/weixin_43405300/category_11525646.html?spm=1001.2014.3001.5482