我正在开发一个使用nvm的项目。
无处不在,我在运行“ npm start”时开始出现此错误:
npm start
> sh ./bin/start.sh
nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/user/.nvm/versions/node/v8.9.4"
Run `unset npm_config_prefix` to unset it.
Found '/Users/user/project/project/.nvmrc' with version <8.9.0>
nvm is not compatible with the "npm_config_prefix" environment variable: currently set to "/Users/user/.nvm/versions/node/v8.9.4"
Run `unset npm_config_prefix` to unset it.
/Users/user/project/project/node_modules/node-sass/lib/binding.js:15
throw new Error(errors.missingBinary());
^
Error: Missing binding /Users/user/project/project/node_modules/node-sass/vendor/darwin-x64-59/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 9.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 8.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
at module.exports (/Users/user/project/project/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/Users/user/project/project/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/user/project/project/node_modules/node-sass/bin/node-sass:10:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @namespace/project@5.14.1 start: `sh ./bin/start.sh`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @namespace/project@5.14.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/user/.npm/_logs/2018-06-19T19_30_15_079Z-debug.log
我已经尝试了以下操作,但没有成功:
1)删除存储库,再次克隆并运行npm install
2)更新npm
3)删除nvm文件夹,然后重新下载
4)运行unset npm_config_prefix
5)运行npm rebuild node-sass --force
不好。:我在Mac OS 10.13.4上使用zsh终端