简体   繁体   English

无法`gulp install`,导致`Cannot read property 'apply' of undefined`

[英]Cannot `gulp install`, results in `Cannot read property 'apply' of undefined`

I have installed NVM and NPM to an EC2 instance using this guide from AWS .我已使用AWS 的本指南将 NVM 和 NPM 安装到 EC2 实例。

I then install gulp and gulp-cli然后我安装 gulp 和 gulp-cli

npm install --global gulp npm install --global gulp

npm install --global gulp-cli npm install --global gulp-cli

Then navigate to my project and run然后导航到我的项目并运行

gulp i吞下我

And I get this error我得到这个错误

/home/ec2-user/.nvm/versions/node/v4.4.5/lib/node_modules/gulp/bin/gulp.js:129 gulpInst.start.apply(gulpInst, toRun); /home/ec2-user/.nvm/versions/node/v4.4.5/lib/node_modules/gulp/bin/gulp.js:129 gulpInst.start.apply(gulpInst, toRun); ^ ^

TypeError: Cannot read property 'apply' of undefined at /home/ec2-user/.nvm/versions/node/v4.4.5/lib/node_modules/gulp/bin/gulp.js:129:19 at nextTickCallbackWith0Args (node.js:420:9) at process._tickCallback (node.js:349:13) at Function.Module.runMain (module.js:443:11) at startup (node.js:139:18) at node.js:968:3类型错误:无法读取 /home/ec2-user/.nvm/versions/node/v4.4.5/lib/node_modules/gulp/bin/gulp.js:129:19 at nextTickCallbackWith0Args (node.js :420:9) at process._tickCallback (node.js:349:13) at Function.Module.runMain (module.js:443:11) at start (node.js:139:18) at node.js:968 :3

node -v returns v4.4.5 node -v返回 v4.4.5

npm -v returns 2.15.5 npm -v返回 2.15.5

gulp -v returns gulp -v返回

[13:22:47] CLI version 3.9.1 [13:22:47] CLI 版本 3.9.1

[13:22:47] Local version 4.0.0-alpha.2 [13:22:47] 本地版本 4.0.0-alpha.2

I am now stuck and unsure how to get gulp i to run我现在被卡住了,不确定如何让gulp i运行

All over the internet, the proposed solution is to run npm install -g gulp-cli .在整个互联网上,建议的解决方案是运行npm install -g gulp-cli At first, this didn't work for me, but after closing and opening a new console , it worked.起初,这对我不起作用,但在关闭并打开一个新控制台后,它起作用了。

This error means that gulpInst.start is undefined .这个错误意味着gulpInst.startundefined

It's impossible to say anything specific without seeing your particular configuration but here are some issues on GitHub related to that:如果没有看到您的特定配置,就不可能说出任何具体内容,但 GitHub 上有一些与此相关的问题:

Hopefully it will help you get started.希望它会帮助你开始。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM