【发布时间】:2021-03-03 03:22:25
【问题描述】:
我在公司代理后面使用节点 14 和 Jenkins,我无法正确安装 node-sass。
所以我在本地安装了两个地方
- 对于 SASS_BINARY_PATH:
/var/jenkins_home/linux-x64-83_binding.node - 对于 SASS_BINARY_DIR:
/var/jenkins_home/vendor/linux-x64-83/binding.node
我试过SASS_BINARY_PATH:
SASS_BINARY_PATH=/var/jenkins_home/linux-x64-83_binding.node npm install node-sass
npm install --no-lockfile
npm run build
但我在构建时收到此错误:
模块构建失败(来自 ./node_modules/mini-css-extract-plugin/dist/loader.js): ModuleBuildError:模块构建失败(来自 ./node_modules/sass-loader/dist/cjs.js): 错误:ENOENT:没有这样的文件或目录,scandir '/var/jenkins_home/workspace/root_project_dir/project/node_modules/node-sass/vendor'
我试过SASS_BINARY_DIR:
SASS_BINARY_DIR=/var/jenkins_home/vendor npm install node-sass
npm install --no-lockfile
npm run build
但这最终会尝试下载二进制文件,这是我首先要避免的问题。
任何帮助将不胜感激!
如果有帮助,这是我的 package.json:
{
"name": "name",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@types/lodash": "4.14.115",
"axios": "^0.18.0",
"@types/chart.js": "^2.7.48",
"chart.js": "^2.7.2",
"chartjs-plugin-datalabels": "0.7.0",
"http2": "^3.3.7",
"lodash": "4.17.10",
"typescript": "^3.2.0",
"vue": "^2.5.16",
"vue-async-computed": "^3.3.1",
"vue-chartjs": "^3.4.0",
"vue-class-component": "^6.0.0",
"vue-property-decorator": "^7.0.0",
"vue-router": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.0.0-rc.12",
"@vue/cli-plugin-typescript": "^3.0.0-beta.15",
"@vue/cli-service": "^3.0.0-beta.15",
"node-sass": "^4.9.0",
"sass-loader": "^7.0.1",
"vue-template-compiler": "^2.5.16"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 8"
]
}
【问题讨论】:
标签: node.js linux vue.js jenkins node-sass