问题一
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博客