好吧,所以我是新的在gulp和sass和我试图使它的工作。我安装了一切正确,但我得到这个愚蠢的错误。有一个解决办法吗?
PS C:\Users\Bojan Kolano\Desktop\Fax i projekti\Portfolio\Product Landing
Page Project> gulp sass:watch
C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-
cli\node_modules\sver-compat\sver.js:19
var semver = version.match(semverRegEx);
^
TypeError: Cannot read property 'match' of undefined
at new Semver (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp- cli\node_modules\sver-compat\sver.js:19:24)
at Function.match (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\sver-compat\sver.js:374:15)
at matches (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\semver-greatest-satisfied-range\index.js:9:24)
at Array.filter (<anonymous>)
at findRange (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\semver-greatest-satisfied-range\index.js:12:28)
at Liftoff.handleArguments (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\index.js:166:15)
at Liftoff.execute (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\liftoff\index.js:203:12)
at module.exports (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\flagged-respawn\index.js:51:3)
at Liftoff.<anonymous> (C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\liftoff\index.js:195:5)
at C:\Users\Bojan Kolano\AppData\Roaming\npm\node_modules\gulp-cli\node_modules\liftoff\index.js:165:9
PS C:\Users\Bojan Kolano\Desktop\Fax i projekti\Portfolio\Product Landing
Page Project>
3条答案
按热度按时间jtw3ybtb1#
删除package-lock.json和node_modules文件夹,然后重新安装所有模块!应该可以工作:)
cxfofazt2#
有很多原因会发生这种情况。对我来说,这是因为我已经全局安装了gulp,但 * 没有 * 将其添加到我的项目中。一旦我安装了gulp(
npm install gulp
),任务就成功运行了。这本应该是显而易见的,但我第一次错过了。ig9co6j13#
删除package-lock.json和node_modules文件夹并重新安装我没有工作。但是看起来我没有全局安装Gulp。所以我做了什么,我只是简单地安装它本地如下:
npm install gulp --save-dev
,现在它工作了。