流星:无法解决模块:"反应/ dom"

时间:2017-07-17 03:13:48

标签: javascript reactjs meteor react-native

我一直在试着用React设置流星。无论我安装React和React-Dom多少次和方式,我在运行" meteor"时都会收到以下消息:命令:

Unable to resolve some modules: "react/dom" in /C/Users/moshe/Desktop/Project/simple-todos/client/main.js (web.browser)
If you notice problems related to these missing modules, consider running: meteor npm install --save react

这是命令行中更详细的消息:

W20170716-23:10:27.871(-4)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt. 
W20170716-23:10:27.874(-4)? (STDERR) While this implementation will work correctly, it is known to be 
W20170716-23:10:27.875(-4)? (STDERR) approximately three times slower than the native implementation. 
W20170716-23:10:27.877(-4)? (STDERR) In order to use the native implementation instead, run 
W20170716-23:10:27.878(-4)? (STDERR) 
W20170716-23:10:27.880(-4)? (STDERR)   meteor npm install --save bcrypt W20170716-23:10:27.882(-4)? (STDERR) 
W20170716-23:10:27.885(-4)? (STDERR) in the root directory of your application. 
I20170716-23:10:28.401(-4)? [Error: Can't find npm module 'react-addons-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.406(-4)? [Error: Can't find npm module 'react-addons-css-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.410(-4)? [Error: Can't find npm module 'react-addons-linked-state-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.415(-4)? [Error: Can't find npm module 'react-addons-create-fragment/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.420(-4)? [Error: Can't find npm module 'react-addons-update/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.426(-4)? [Error: Can't find npm module 'react-addons-pure-render-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:28.450(-4)? [Error: Can't find npm module 'react-addons-perf/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
W20170716-23:10:28.452(-4)? (STDERR) WARNING: npm peer requirements (for react-runtime) not installed: 
W20170716-23:10:28.453(-4)? (STDERR)  - react-addons-transition-group@15.x not installed. 
W20170716-23:10:28.454(-4)? (STDERR)  - react-addons-css-transition-group@15.x not installed. 
W20170716-23:10:28.456(-4)? (STDERR)  - react-addons-linked-state-mixin@15.x not installed. 
W20170716-23:10:28.457(-4)? (STDERR)  - react-addons-create-fragment@15.x not installed. 
W20170716-23:10:28.459(-4)? (STDERR)  - react-addons-update@15.x not installed. 
W20170716-23:10:28.464(-4)? (STDERR)  - react-addons-pure-render-mixin@15.x not installed. 
W20170716-23:10:28.466(-4)? (STDERR)  - react-addons-perf@15.x not installed. 
W20170716-23:10:28.468(-4)? (STDERR) 
W20170716-23:10:28.470(-4)? (STDERR) Read more about installing npm peer dependencies: 
W20170716-23:10:28.472(-4)? (STDERR)   http://guide.meteor.com/using-packages.html#peer-npm-dependencies 
W20170716-23:10:28.475(-4)? (STDERR) 
W20170716-23:10:28.913(-4)? (STDERR) C:\Users\moshe\AppData\Local\.meteor\packages\meteor-tool\1.5.1\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:280 
W20170716-23:10:28.919(-4)? (STDERR)                                   throw(ex); 
W20170716-23:10:28.921(-4)? (STDERR)                        ^ 
W20170716-23:10:28.922(-4)? (STDERR) 
W20170716-23:10:28.924(-4)? (STDERR) Error: Can't find npm module 'react-addons-transition-group'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package? 
W20170716-23:10:28.931(-4)? (STDERR)     at Object.require (C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\boot.js:230:17) 
W20170716-23:10:28.934(-4)? (STDERR)     at makeInstallerOptions.fallback (packages\modules-runtime.js:641:18) 
W20170716-23:10:28.936(-4)? (STDERR)     at require (packages\modules-runtime.js:234:16) 
W20170716-23:10:28.939(-4)? (STDERR)     at meteorInstall.node_modules.meteor.react-runtime.react-runtime.js (packages/react-runtime/react-runtime.js:29:20) 
W20170716-23:10:28.942(-4)? (STDERR)     at fileEvaluate (packages\modules-runtime.js:333:9) 
W20170716-23:10:28.944(-4)? (STDERR)     at require (packages\modules-runtime.js:228:16) 
W20170716-23:10:28.945(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\packages\react-runtime.js:111:15 
W20170716-23:10:28.951(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\packages\react-runtime.js:124:3 
W20170716-23:10:28.954(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\boot.js:338:34 
W20170716-23:10:28.956(-4)? (STDERR)     at Array.forEach (native)
    => Exited with code: 1

    Unable to resolve some modules:

      "react/dom" in /C/Users/moshe/Desktop/Project/simple-todos/client/main.js (web.browser)

    If you notice problems related to these missing modules, consider running:

      meteor npm install --save react


W20170716-23:10:35.307(-4)? (STDERR) Note: you are using a pure-JavaScript implementation of bcrypt. 
W20170716-23:10:35.308(-4)? (STDERR) While this implementation will work correctly, it is known to be 
W20170716-23:10:35.309(-4)? (STDERR) approximately three times slower than the native implementation. 
W20170716-23:10:35.310(-4)? (STDERR) In order to use the native implementation instead, run 
W20170716-23:10:35.311(-4)? (STDERR) 
W20170716-23:10:35.312(-4)? (STDERR)   meteor npm install --save bcrypt W20170716-23:10:35.313(-4)? (STDERR) 
W20170716-23:10:35.314(-4)? (STDERR) in the root directory of your application. 
I20170716-23:10:35.712(-4)? [Error: Can't find npm module 'react-addons-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.715(-4)? [Error: Can't find npm module 'react-addons-css-transition-group/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.718(-4)? [Error: Can't find npm module 'react-addons-linked-state-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.721(-4)? [Error: Can't find npm module 'react-addons-create-fragment/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.724(-4)? [Error: Can't find npm module 'react-addons-update/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.727(-4)? [Error: Can't find npm module 'react-addons-pure-render-mixin/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
I20170716-23:10:35.742(-4)? [Error: Can't find npm module 'react-addons-perf/package.json'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?] 
W20170716-23:10:35.743(-4)? (STDERR) WARNING: npm peer requirements (for react-runtime) not installed: 
W20170716-23:10:35.747(-4)? (STDERR)  - react-addons-transition-group@15.x not installed. 
W20170716-23:10:35.748(-4)? (STDERR)  - react-addons-css-transition-group@15.x not installed. 
W20170716-23:10:35.749(-4)? (STDERR)  - react-addons-linked-state-mixin@15.x not installed. 
W20170716-23:10:35.750(-4)? (STDERR)  - react-addons-create-fragment@15.x not installed. 
W20170716-23:10:35.751(-4)? (STDERR)  - react-addons-update@15.x not installed. 
W20170716-23:10:35.752(-4)? (STDERR)  - react-addons-pure-render-mixin@15.x not installed. 
W20170716-23:10:35.753(-4)? (STDERR)  - react-addons-perf@15.x not installed. 
W20170716-23:10:35.755(-4)? (STDERR) 
W20170716-23:10:35.761(-4)? (STDERR) Read more about installing npm peer dependencies: 
W20170716-23:10:35.763(-4)? (STDERR)   http://guide.meteor.com/using-packages.html#peer-npm-dependencies 
W20170716-23:10:35.764(-4)? (STDERR) 
W20170716-23:10:36.104(-4)? (STDERR) C:\Users\moshe\AppData\Local\.meteor\packages\meteor-tool\1.5.1\mt-os.windows.x86_32\dev_bundle\server-lib\node_modules\fibers\future.js:280 
W20170716-23:10:36.109(-4)? (STDERR)                                   throw(ex); 
W20170716-23:10:36.110(-4)? (STDERR)                        ^ 
W20170716-23:10:36.111(-4)? (STDERR) 
W20170716-23:10:36.112(-4)? (STDERR) Error: Can't find npm module 'react-addons-transition-group'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package? 
W20170716-23:10:36.113(-4)? (STDERR)     at Object.require (C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\boot.js:230:17) W20170716-23:10:36.115(-4)? (STDERR)     at makeInstallerOptions.fallback (packages\modules-runtime.js:641:18) 
W20170716-23:10:36.118(-4)? (STDERR)     at require (packages\modules-runtime.js:234:16) 
W20170716-23:10:36.119(-4)? (STDERR)     at meteorInstall.node_modules.meteor.react-runtime.react-runtime.js (packages/react-runtime/react-runtime.js:29:20) 
W20170716-23:10:36.121(-4)? (STDERR)     at fileEvaluate (packages\modules-runtime.js:333:9) 
W20170716-23:10:36.122(-4)? (STDERR)     at require (packages\modules-runtime.js:228:16) 
W20170716-23:10:36.123(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\packages\react-runtime.js:111:15 
W20170716-23:10:36.124(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\packages\react-runtime.js:124:3 
W20170716-23:10:36.127(-4)? (STDERR)     at C:\Users\moshe\Desktop\Project\simple-todos\.meteor\local\build\programs\server\boot.js:338:34 
W20170716-23:10:36.131(-4)? (STDERR)     at Array.forEach (native)

我非常感谢帮助,因为我正在学习如何开始工作。

谢谢!

1 个答案:

答案 0 :(得分:3)

您应该像这样安装React和React DOM:

meteor npm install --save react react-dom

成功安装后,您可以将这些模块导入到您自己的js模块中,如:

import React from 'react';
import ReactDOM from 'react-dom';