MAC M2芯片 跑vue2.0项目 install 报错
现在是 node14 版本
```shell
frontend % npm install
npm WARN deprecated tar@2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm WARN lifecycle The node binary used for scripts is /opt/homebrew/opt/node@14/bin/node but npm is using /opt/homebrew/Cellar/node@14/14.21.3/libexec/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
> node-sass@4.14.1 install /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-sass
> node scripts/install.js
Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.14.1/darwin-arm64-83_binding.node
Cannot download "https://npm.taobao.org/mirrors/node-sass/v4.14.1/darwin-arm64-83_binding.node":
HTTP error 404 Not Found
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
> node-sass@4.14.1 postinstall /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-sass
> node scripts/build.js
Building: /opt/homebrew/Cellar/node@14/14.21.3/libexec/node /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-gyp/bin/node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
gyp info it worked if it ends with ok
gyp verb cli [
gyp verb cli '/opt/homebrew/Cellar/node@14/14.21.3/libexec/node',
gyp verb cli '/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-gyp/bin/node-gyp.js',
gyp verb cli 'rebuild',
gyp verb cli '--verbose',
gyp verb cli '--libsass_ext=',
gyp verb cli '--libsass_cflags=',
gyp verb cli '--libsass_ldflags=',
gyp verb cli '--libsass_library='
gyp verb cli ]
gyp info using node-gyp@3.8.0
gyp info using node@14.21.3 | darwin | arm64
gyp verb command rebuild []
gyp verb command clean []
gyp verb clean removing "build" directory
gyp verb command configure []
gyp verb check python checking for Python executable "python2" in the PATH
gyp verb `which` failed Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:192:21)
gyp verb `which` failed python2 Error: not found: python2
gyp verb `which` failed at getNotFoundError (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:13:12)
gyp verb `which` failed at F (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:68:19)
gyp verb `which` failed at E (/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:80:29)
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/which/which.js:89:16
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/isexe/index.js:42:5
gyp verb `which` failed at /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/isexe/mode.js:8:5
gyp verb `which` failed at FSReqCallback.oncomplete (fs.js:192:21) {
gyp verb `which` failed code: 'ENOENT'
gyp verb `which` failed }
gyp verb check python checking for Python executable "python" in the PATH
gyp verb `which` succeeded python /Users/whales/miniconda3/bin/python
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/whales/miniconda3/bin/python -c import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack File "<string>", line 1
gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
gyp ERR! stack
gyp ERR! stack at ChildProcess.exithandler (child_process.js:383:12)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at maybeClose (internal/child_process.js:1088:16)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/opt/homebrew/Cellar/node@14/14.21.3/libexec/node" "/Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
gyp ERR! cwd /Users/whales/project/ibuild-cscec82-hr/frontend/node_modules/node-sass
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
npm WARN webpack-require-from@1.8.6 requires a peer of tapable@^2.2.0 but none is installed. You must install peer dependencies yourself.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@4.14.1 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@4.14.1 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/whales/.npm/_logs/2023-05-19T14_25_24_434Z-debug.log
```
node-sass不支持m2型片,所以你只能将node-sass改成sass就行,然后将/deep/改成::v-deep就行其他语法基本上是一样的
主要是因为 node版本高 node-sass为v4 版本 太低他俩不兼容,但是这项目我也没法去升级node-sass ,node版本最低只能14 再往下M2 不兼容了,这种情况怎么搞? 能不能用其他电脑node-sass安装完我从 node_modules 目录下复制出来 ,然后拷贝的项目里?如果可行的话我需要拷贝的文件夹名称是什么?