错误:
[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