运行 npm start 时出错:nvm 与“npm_config_prefix”环境变量不兼容

Lea*_*dro 6 macos npm nvm

我正在开发一个使用 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
Run Code Online (Sandbox Code Playgroud)

我已经尝试过以下操作但没有成功:

1)删除repo,再次克隆并运行npm install

2)更新npm

3)删除nvm文件夹并重新下载

4)运行unset npm_config_prefix

5) 跑步npm rebuild node-sass --force

观察:我在 Mac OS 10.13.4 上使用 zsh 终端

Jon*_*lez 0

nvm deactivate按照此处的建议运行,错误消失了。我只运行了该命令,没有运行其他命令。