项目git clone下来之后,运行npminstall, npm start报错代码如下:
ERROR in ENOENT: no such file or directory, scandir 'E:Reacthelloworld
ode_modules
ode-sassvendor'
@ ./src/layouts/CoreLayout/CoreLayout.scss 4:14-284 13:2-17:4 14:20-290
其原因是windows下的node-sass编译没通过,需要下载微软的编译环境及工具,但也有直接解决方案:
方案一、
- 创建目录E:Reacthelloworld ode_modules ode-sassvendor
- 再次运行npm start,查看报错如下
ERROR in Missing binding E:React
eact-redux-starter-kit-go
ode_modules
ode-sassvendorwin32-x64-47inding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 5.x
- 去https://github.com/sass/node-sass/releases下载对应版本的node-sass的binding.node,比如我这里就要下载
win32-x64-47_binding.pdb
- 将该文件改名放到E:React eact-redux-starter-kit-go ode_modules ode-sassvendorwin32-x64-47inding.node
方案二、
- 使用https://npm.taobao.org 阿里的镜像安装
npm方式:
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
yarn方式:
npm install -g tyarn --registry=https://registry.npm.taobao.org
tyarn