简体   繁体   English

我尝试使用Grunt时出现语法错误

[英]Syntax Error When I Try to Use Grunt

I'm getting the following error when I try to use "grunt serve". 当我尝试使用“grunt serve”时,我收到以下错误。

/Users/name/Documents/projectname/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.js:6755

});



SyntaxError: Unexpected end of input
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/Users/name/Documents/projectname/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js:16:9)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Any help would be appreciated. 任何帮助,将不胜感激。 Thank you! 谢谢!

-Dave 戴夫

I had a similar issue that produced the same SyntaxError: Unexpected end of input error for me. 我有一个类似的问题,产生相同的SyntaxError: Unexpected end of input错误的SyntaxError: Unexpected end of input对我来说。 Resolution for this was to remove my project's node_modules directory and re-run npm install. 对此的解决方法是删除项目的node_modules目录并重新运行npm install。 If you are using a linux machine make sure to run it as sudo npm install whereas on windows you'll want to run your command prompt as Admin. 如果您使用的是linux机器,请确保以sudo npm install运行它,而在Windows上,您需要以管理员身份运行命令提示符。 Hope this helps! 希望这可以帮助!

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

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