Closed sumshare closed 7 years ago
npm 要 3.0 以上
@QingWei-Li 已经将node重装并升到最新版本,仍然会报这个错误。
是 npm 升到最新版,你把完整的错误信息贴一下
@QingWei-Li [cooking] - generator project module.js:457 throw err; ^
Error: Cannot find module 'gulp-install'
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.
我在Windows环境尝试的时候也发生了类似的错误, [cooking] -generatoe project No local gulp install found in xx.cooking\node_modules\slush-cooking-vue [slush]this is an issue with the 'slush-cooking-vue' generator 在slushfile.js:2:15是 var install = require('gulp-install'),因此我觉得是出于同一种原因
如果你用的是 npm 3+ 那么依赖目录是平级的,gulp-install 这些依赖在你第一次运行 init 的时候就已经帮你安装在 .cooking/node_modules
中了,你可以看下这个目录下面有没有 gulp-install
补充下,如果你前面用 npm 2 安装的 cooking,然后报错后升级到 npm 3 这个时候由于依赖已经安装了,路径依旧是错的,所以你应该升级到 npm 3 后把 .cooking
目录删掉,重新运行 cooking init
@QingWei-Li 是的,问题解决了,非常感谢,应该把.cooking先删除,不然重装也是没有用的。
cooking version
在init 的时候报这个错误,