npm 常见问题

问题一

1.npm - v
npm does not support Node.js v13.14.0
You should probably upgrade to a newer version of node as we
can't make any promises that npm will work with this version.
You can find the latest version at https://nodejs.org/

8.19.2

2.项目内:npm -g install @6.14.4

npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name "@6.14.4" of package "@6.14.4": Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:

3.管理员身份打开cmd npm -g install npm@6.14.4

4.回到项目内 npm -g install npm@6.14.4

成功后查看 npm -v

问题二

1.npm install

/node-sass/releases/download/v9.0.0/win32-x64-79_binding.node":

read ECONNRESET

Hint: If github.com is not accessible in your location
      try setting a proxy via HTTP_PROXY, e.g.

      export HTTP_PROXY=http://example.com:1234

or configure npm proxy via

      npm config set proxy http://example.com:8080

 Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if the py launcher can be used to find Python
gyp ERR! find Python - "py.exe" is not in PATH or produced an error

Failed at the node-sass@6.0.1 postinstall script.

管理员身份打开

npm install -g node-gyp

npm install --global --production windows-build-tools

切换node-sass安装镜像npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@9.0.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@9.0.0 postinstall script.

node-gyp clean

npm install

npm run dev

问题三

 in ./src/styles/common.scss

Syntax Error: ModuleError: Module Error (from ./node_modules/sass-loader/dist/cjs.js):
Cannot find module 'sass'
Require stack:

删除node_modules

npm cache clean -f

在写样式时,出现Cannot find module ‘sass‘问题 已解决√_cannot find module 'sass_77快乐的博客-CSDN博客

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值