Javascript 流星错误:未捕获错误:找不到模块';jsx';
我有一个问题完全难住了我 我有一个Meteor/React应用程序,我已经开发了一周了。在我的桌面上一切都很好。今天我抓起我的MacBook,从Github中取出代码并运行它 应用程序在JavaScript控制台中抛出错误:Javascript 流星错误:未捕获错误:找不到模块';jsx';,javascript,meteor,npm,Javascript,Meteor,Npm,我有一个问题完全难住了我 我有一个Meteor/React应用程序,我已经开发了一周了。在我的桌面上一切都很好。今天我抓起我的MacBook,从Github中取出代码并运行它 应用程序在JavaScript控制台中抛出错误: modules runtime.js?hash=637cb12…:139 Uncaught Error: Cannot find module '../../ui/components/signin/Signin.jsx' at Function.require.r
modules runtime.js?hash=637cb12…:139
Uncaught Error: Cannot find module '../../ui/components/signin/Signin.jsx'
at Function.require.resolve (modules-runtime.js?hash=637cb12…:139)
at Module.resolve (modules-runtime.js?hash=637cb12…:91)
at Module.Mp.import (printer.js:170)
at meteorInstall.imports.startup.client.routes.jsx (routes.jsx:1)
at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
at Module.require (modules-runtime.js?hash=637cb12…:116)
at Module.Mp.import (printer.js:170)
at meteorInstall.imports.startup.client.index.js (index.js:1)
at fileEvaluate (modules-runtime.js?hash=637cb12…:191)
at Module.require (modules-runtime.js?hash=637cb12…:116)
我将应用程序克隆到桌面上的一个新文件夹中,也遇到了同样的问题。我已经删除了对Signin.jsx模块的所有引用,但是我也得到了对其他模块的错误抛出
我不知道是什么原因导致了这个问题,这个应用程序在我原来的开发目录中运行得很好,但是一旦我把它拉到一个新目录中,我就会在JS控制台中看到这个错误
我试过:
meteor reset
meteor npm rebuild
meteor npm install
meteor update
它们都没有带来任何不同。非常感谢你的帮助
编辑
当我在新目录中运行meteor npm install时,我得到以下错误,可能与问题有关
> bcrypt@1.0.2 install /Users/s/Desktop/calendar/node_modules/bcrypt
> node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.2/bcrypt_lib-v1.0.2-node-v46-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for bcrypt@1.0.2 and node@4.6.2 (node-v46 ABI) (falling back to source compile with node-gyp)
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
CXX(target) Release/obj.target/bcrypt_lib/src/blowfish.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt.o
CXX(target) Release/obj.target/bcrypt_lib/src/bcrypt_node.o
SOLINK_MODULE(target) Release/bcrypt_lib.node
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9
COPY /Users/s/Desktop/calendar/node_modules/bcrypt/lib/binding/bcrypt_lib.node
TOUCH Release/obj.target/action_after_build.stamp
我已经知道问题出在哪里了。几天前我重命名了一些文件,将它们更改为与它们包含的React组件的名称完全相同 例如,我重命名了signin.jsx->signin.jsx 出于某种原因,github没有注意到一些文件的这种变化,所以当我推动回购协议时,我的一些导入被破坏了 这就是为什么该应用程序在我的目录中工作得很好,但在任何克隆目录中都不工作
感谢您的帮助Meteor Running Instance每次创建文件夹时 /流星/本地 请删除此文件夹
如果您更改了项目目录,请不要打开此文件夹。如果使用git,请在创建gitignore文件时初始化git。这将在git推送本地文件夹期间被删除。您确定大小写正确吗?`'/ui/components/signin/signin.jsx'双重检查您的import/require语句是否使用确切的大写字母作为实际文件。你能在导入组件的地方发布一段代码吗?是的,外壳很完美。该应用程序在我正在开发的原始目录中100%完美地工作,只有当我将其克隆到一个新目录时,它才会中断(这让我觉得问题与node_modules文件夹有关,因为它没有被推送到github。请检查我的编辑!在运行npm安装之前,请删除.meteor文件夹中的本地文件夹。伙计们,我已经解决了,谢谢你们的帮助。)