- 打开 github上的nodejieba项目,查看nodejieba的使用方法。
- 使用以下命令安装nodejieba
npm install nodejieba
- 由于nodejieba的底层算法实现是C++,所以需要安装node-gyp来编译原生C++扩展模块。
npm install -g node-gyp
- 而node-gyp需要依赖环境,因此需要进行环境配置,在window系统上的配置方法有两种。github上的node-gyp。如果英文看的费劲,可以看这个中文的。
- 一切都配置好后可以再重新
npm install nodejieba
注意:记得添加python路径。
总得来说就是先安装好node-gyp后,再安装nodejieba。