-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
biqing.hu
committed
Feb 14, 2022
1 parent
d2b2b9b
commit 9133944
Showing
2 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// npm config set sass-binary-path D:/node-binaries/node-sass-win32-x64-57_binding.node | ||
|
||
// yarn config set sass-binary-path D:/node-binaries/node-sass-win32-x64-57_binding.node | ||
//https://npm.taobao.org/mirrors/node-sass/v4.5.3/win32-x64-57_binding.node | ||
|
||
|
||
import { _, exec, getCurrentBranchName, cwd, consoleColor, io, checkOS } from '../lib' | ||
/** | ||
* 配置sass | ||
*/ | ||
export default { | ||
/** | ||
* 启动 | ||
*/ | ||
async start(data) { | ||
const binarySite = `http://npm.taobao.org/mirrors${data.package}` | ||
const npmCmdStr = `npm config set ${data.package}-binary-site ${binarySite}` | ||
const yarnCmdStr = `yarn config set ${data.package}-binary-site ${binarySite}` | ||
|
||
try { | ||
consoleColor.start(npmCmdStr) | ||
await exec(npmCmdStr) | ||
} catch (e) { | ||
consoleColor.error(e) | ||
} | ||
try { | ||
consoleColor.start(yarnCmdStr) | ||
await exec(yarnCmdStr) | ||
} catch (e) { | ||
} | ||
}, | ||
command: [ | ||
'<package>', | ||
'操作系统设置 npm|yarn config set xxx-binary-site 为 taobaonpm 解决 xxx 安装缓慢问题', | ||
{ | ||
|
||
} | ||
] | ||
} |