简体   繁体   English

Grunt + Browserify + React无法找到被调用的模块

[英]Grunt + Browserify + React cannot find called modules

I'm trying to set up a development server on Ubuntu 14 and am using Grunt + Browserify. 我正在尝试在Ubuntu 14上设置开发服务器,并正在使用Grunt + Browserify。 I'm able to make the code run and if I use Grunt to watch for sass changes those work. 我能够使代码运行,并且如果我使用Grunt来监视sass,则可以更改这些工作。 However, any time I make a change to a react file that calls on another module I get an error like this: 但是,每当我对调用另一个模块的react文件进行更改时,都会收到如下错误:

Error: Cannot find module '../../actions/mainActions' from '/var/www/p/web/sites/docroot/js/flux/app/components/pages' Warning: Error running grunt-browserify. 错误:从'/ var / www / p / web / sites / docroot / js / flux / app / components / pages'中找不到模块'../../actions/mainActions'警告:运行grunt-browserify时出错。

Fatal error: Callback was already called. 致命错误:已经调用了回调。

This works in an OS X environment and Windows environment, but not so far on Ubuntu. 这可以在OS X环境和Windows环境中使用,但到目前为止在Ubuntu上还不行。

Any suggestions? 有什么建议么?

We figured out the issue, turns out since Linux is case-sensitive it was unable to find "mainActions" as the file itself was named "MainActions". 我们发现了问题,事实证明,由于Linux区分大小写,因此无法找到“ mainActions”,因为文件本身被命名为“ MainActions”。 Good overview on the topic: https://gist.github.com/domenic/2790533 关于该主题的很好的概述: https : //gist.github.com/domenic/2790533

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

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