Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-sass version好像不对,但是又装不上^4.0.0的 #129

Open
xuwuqiang opened this issue Oct 14, 2021 · 8 comments
Open

node-sass version好像不对,但是又装不上^4.0.0的 #129

xuwuqiang opened this issue Oct 14, 2021 · 8 comments

Comments

@xuwuqiang
Copy link

一开始报python没有,装了之后报vscode没有,装了之后install成功了,但是npm run的时候提示node-sass下面的vendor目录缺少东西,我一看根本就没有vendor目录,找到node-sass的github,还是没有找到vendor目录,在stackoverflow上搜到说是需要自己创建vendor目录,并且下载对应的binding.node文件放进去,放进去之后提示我node-sass版本太高,于是我安装node-sass^4.0.0,就装不上了.

我最后一次的命令是 npm install node-sass@^4.0.0
报错信息是
npm ERR! code 1
npm ERR! path D:\project\mall-admin-web\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@14.17.3 | win32 | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Command failed: D:\laragon\bin\python3\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack File "", line 1
npm ERR! gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
npm ERR! gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
npm ERR! gyp ERR! stack
npm ERR! gyp ERR! stack at ChildProcess.exithandler (child_process.js:319:12)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:375:28)
npm ERR! gyp ERR! stack at maybeClose (internal/child_process.js:1055:16)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\app\nodejs\node.exe" "D:\project\mall-admin-web\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\project\mall-admin-web\node_modules\node-sass
npm ERR! gyp ERR! node -v v14.17.3
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

看上去是一个python的错误,我已经折腾一天了,本来是想学习一下springboot的,结果这一天下来不知道在干嘛,这些前端的问题对我真的不太友好..............

@xuwuqiang
Copy link
Author

给我的一种感觉是这个项目因为node版本的原因年久失修....

@xuwuqiang
Copy link
Author

最后安装上了
npm install node-sass@^4.14.0
下载文件 : https://github.com/sass/node-sass/releases/download/v4.14.1/win32-x64-83_binding.node
移动 : mv win32-x64-83_binding.node mall-admin-web/node_modules/node-sass/vendor/win32-x64-83/binding.node
npm run dev

@xuwuqiang
Copy link
Author

说明下我的本地环境
system win10
npm -v 7.23.0
node -v v14.17.3

@SHEEP-PLUS
Copy link

先删除 npm uninstall node-sass
再安装最新版本 npm install node-sass@latest

@wangdi7670
Copy link

我是这么解决的:
npm install node-sass@latest --sass-binary-site=https://npm.taobao.org/mirrors/node-sass
本地环境:node v16.13.0
这里有node 和node-sass版本对应关系

@silent-waiting
Copy link

npm install --unsafe-perm //这是解决gyp报错的方法

@Zenquan
Copy link

Zenquan commented Apr 15, 2022

npm rebuild node-sass 即可解决

@xiaochengzjc
Copy link

我是这么解决的: npm install node-sass@latest --sass-binary-site=https://npm.taobao.org/mirrors/node-sass 本地环境:node v16.13.0 这里有node 和node-sass版本对应关系

正解

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants