grunt下编译jade报错

今天在使用grunt来进行jade和sass变成的时候碰到错误 Error: Cannot find module ‘promise’

1.第一步的做法我是利用 npm将grunt和grunt-cli去不卸载,然后在冲撞,然后安装安装方案,npm install -d帮助你配置需要的环境
,还可以帮你重置package.json, 重新运行grunt start 没有错误,保存jade的时候还是出现
span sytle=”color:red”>Error: Cannot find module ‘promise’

2.根据报错 Cannot find module ‘promise’ 然后我使用 npm install promise -g 来安装promise, ‘-g’意思为全局变量,重新运行grunt start没有问题,但是保存jade
的时候还是出新 Error: Cannot find module ‘promise’

3.npm link 对开发模块进行引用 因为缺少了 primise 我使用 npm link promise 将promise 模版加入环境中,Error: Cannot find module ‘promise’
错误没有了,但紧接着出现 Error: Cannot find module ‘grunt’ 然后接着 npm link grunt, 只有出现没有的模版 就npm link grunt
### 解决方案,只有出现Error: Cannot find module ‘xxx’ 就利用npm link xxx至到没有错误 ,success。