node-sass@^4.14.1 run postinstall node scripts/build.js error: Error: Command failed with exit code

错误:

[npminstall:runscript:error] node-sass@^4.14.1 run postinstall node scripts/build.js error: Error: Command failed with exit code 1: node scripts/build.js
    at makeError (/usr/local/lib/node_modules/cnpm/node_modules/execa/lib/error.js:60:11)
    at handlePromise (/usr/local/lib/node_modules/cnpm/node_modules/execa/index.js:118:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async exports.runScript (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/utils.js:261:12)
    at async runLifecycleScripts (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/lifecycle_scripts.js:66:7)
    at async _install (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install_package.js:321:5)
    at async install (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/install_package.js:23:12)
    at async _installOne (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/local_install.js:215:15)
    at async mapper (/usr/local/lib/node_modules/cnpm/node_modules/npminstall/lib/local_install.js:140:5) {
  shortMessage: 'Command failed with exit code 1: node scripts/build.js',
  command: 'node scripts/build.js',
  escapedCommand: 'node "scripts/build.js"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
✖ Install fail! Error: run postinstall error, please remove node_modules before retry!

解决方式:

sh: webpack-dev-server: command not found
didi@MacBook-Pro fit-front % cnpm install node-sass@npm:sass --ignore-scripts
✔ Linked 4 latest versions fallback to /Users/didi/Desktop/code/fit-front/node_modules/.store/node_modules
✔ Installed 1 packages on /Users/didi/Desktop/code/fit-front
✔ All packages installed (2 packages installed from npm registry, used 907ms(network 905ms), speed 1.11MB/s, json 2(94.16KB), tarball 933.75KB, manifests cache hit 2, etag hit 2 / miss 0)

dependencies:
+ node-sass npm:sass

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值