Error: Can't find npm module 'react'. Did you forget to call 'Npm.depends' in package.js within the 'modules-runtime' package?

Came across the below noted “Error Message” after upgrading to METEOR@1.3 and updating these three to their latest versions:
cosmos:browserify upgraded from 0.9.4 to 0.10.0
dburles:mongo-collection-instances upgraded from 0.3.4 to 0.3.5
lai:collection-extensions upgraded from 0.1.4 to 0.2.1_1

“Error: Can’t find npm module ‘react’. Did you forget to call ‘Npm.depends’ in package.js within the ‘modules-runtime’ package?”

1 Like

It sounds like one of these packages requires react as a peer dependency (i.e. they expect your app to have it installed).

Can you try meteor npm install in your project root?

If react didn’t appear in that list, can you try meteor npm install --save react?

If that still doesn’t help, can you paste the full stack trace of the that error?

2 Likes

Hi gadicc, thank you for the reply…

It says:

Unable to resolve some modules:

“react” in /C/Users/AppData/Local/.meteor/packages/react-meteor-data/0.2.7/os/createContainer.jsx
(os.windows.x86_32)
“react-dom” in /C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js
(os.windows.x86_32)
“react-addons-transition-group” in
/C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js (os.windows.x86_32)
“react-addons-css-transition-group” in
/C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js (os.windows.x86_32)
“react-addons-linked-state-mixin” in
/C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js (os.windows.x86_32)
“react-addons-create-fragment” in
/C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js (os.windows.x86_32)
“react-addons-update” in /C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js
(os.windows.x86_32)
“react-addons-pure-render-mixin” in
/C/Users/AppData/Local/.meteor/packages/react-meteor-data/0.2.7/os/createContainer.jsx (os.windows.x86_32)
“react-addons-test-utils” in
/C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js (os.windows.x86_32)
“react-addons-perf” in /C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js
(os.windows.x86_32)
“react-dom/server” in /C/Users/AppData/Local/.meteor/packages/react-runtime/0.14.5/os/react-runtime.js
(os.windows.x86_32)

Consider running: meteor npm install --save react react-dom react-addons-transition-group
react-addons-css-transition-group react-addons-linked-state-mixin react-addons-create-fragment react-addons-update
react-addons-pure-render-mixin react-addons-test-utils react-addons-perf

I did this and it works! :slight_smile:

meteor npm install --save react react-dom react-addons-transition-group
react-addons-css-transition-group react-addons-linked-state-mixin react-addons-create-fragment react-addons-update react-addons-pure-render-mixin react-addons-test-utils react-addons-perf

3 Likes

Ah, yeah, there were a few others too :slight_smile: Great that meteor now tells you what to do, in the betas you had to figure this out on your own.

2 Likes

After using meteor npm install --save react react-dom react-addons-transition-group
react-addons-css-transition-group react-addons-linked-state-mixin react-addons-create-fragment react-addons-update react-addons-pure-render-mixin react-addons-test-utils react-addons-perf it worked but I am getting blank screen with body having empty div with id react-root looks like lot is changed in meteor 1.3 than meteor 1.2 for using reactJS!

1 Like

For me, removing the versions file, and then running that line worked!!! Thanks!!

meteor npm install --save react react-dom react-addons-transition-group react-addons-css-transition-group react-addons-linked-state-mixin react-addons-create-fragment react-addons-update react-addons-pure-render-mixin react-addons-test-utils react-addons-perf

1 Like

=> Exited with code: 1
W20161115-14:45:36.153(5.5)? (STDERR) /home/iassureit-03/.meteor/packages/meteor-tool/.1.4.1_1.xujesq++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20161115-14:45:36.153(5.5)? (STDERR) throw(ex);
W20161115-14:45:36.154(5.5)? (STDERR) ^
W20161115-14:45:36.154(5.5)? (STDERR)
W20161115-14:45:36.154(5.5)? (STDERR) Error: Can’t find npm module ‘meteor/http’. Did you forget to call ‘Npm.depends’ in package.js within the ‘modules-runtime’ package?
W20161115-14:45:36.155(5.5)? (STDERR) at Object.Npm.require (/var/www/meteor/e-business/.meteor/local/build/programs/server/boot.js:198:17)
W20161115-14:45:36.155(5.5)? (STDERR) at options.fallback (packages/modules-runtime/modules-runtime.js:30:1)
W20161115-14:45:36.155(5.5)? (STDERR) at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:95:1)
W20161115-14:45:36.156(5.5)? (STDERR) at Module.Mp.import (/home/iassureit-03/.meteor/packages/modules/.0.7.7.1rce8xz++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
W20161115-14:45:36.156(5.5)? (STDERR) at meteorInstall.imports.api.orderMaster.js (imports/api/orderMaster.js:1:1)
W20161115-14:45:36.156(5.5)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:164:1)
W20161115-14:45:36.156(5.5)? (STDERR) at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:89:1)
W20161115-14:45:36.157(5.5)? (STDERR) at Module.Mp.import (/home/iassureit-03/.meteor/packages/modules/.0.7.7.1rce8xz++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
W20161115-14:45:36.157(5.5)? (STDERR) at meteorInstall.server.main.js (server/main.js:1:1)
W20161115-14:45:36.158(5.5)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:164:1)
=> Exited with code: 1
W20161115-14:45:41.635(5.5)? (STDERR) /home/iassureit-03/.meteor/packages/meteor-tool/.1.4.1_1.xujesq++os.linux.x86_64+web.browser+web.cordova/mt-os.linux.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280
W20161115-14:45:41.635(5.5)? (STDERR) throw(ex);
W20161115-14:45:41.636(5.5)? (STDERR) ^
W20161115-14:45:41.637(5.5)? (STDERR)
W20161115-14:45:41.637(5.5)? (STDERR) Error: Can’t find npm module ‘meteor/http’. Did you forget to call ‘Npm.depends’ in package.js within the ‘modules-runtime’ package?
W20161115-14:45:41.637(5.5)? (STDERR) at Object.Npm.require (/var/www/meteor/e-business/.meteor/local/build/programs/server/boot.js:198:17)
W20161115-14:45:41.638(5.5)? (STDERR) at options.fallback (packages/modules-runtime/modules-runtime.js:30:1)
W20161115-14:45:41.638(5.5)? (STDERR) at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:95:1)
W20161115-14:45:41.638(5.5)? (STDERR) at Module.Mp.import (/home/iassureit-03/.meteor/packages/modules/.0.7.7.1rce8xz++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
W20161115-14:45:41.639(5.5)? (STDERR) at meteorInstall.imports.api.orderMaster.js (imports/api/orderMaster.js:1:1)
W20161115-14:45:41.639(5.5)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:164:1)
W20161115-14:45:41.639(5.5)? (STDERR) at Module.require (packages/modules-runtime/.npm/package/node_modules/install/install.js:89:1)
W20161115-14:45:41.640(5.5)? (STDERR) at Module.Mp.import (/home/iassureit-03/.meteor/packages/modules/.0.7.7.1rce8xz++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
W20161115-14:45:41.640(5.5)? (STDERR) at meteorInstall.server.main.js (server/main.js:1:1)
W20161115-14:45:41.640(5.5)? (STDERR) at fileEvaluate (packages/modules-runtime/.npm/package/node_modules/install/install.js:164:1)

Any idea why this is coming i have tried both the commands??

is there any elegant solution than this?

install with npm the libraries that couldnt find interesting react like below
Windows PowerShell
Copyright © 2016 Microsoft Corporation. All rights reserved.

PS D:\tools\adelin\adelin> npm install react-addons-transition-group@15.x

  • react-addons-transition-group@15.6.0
    added 1 package in 1.294s
    PS D:\tools\adelin\adelin> npm install react-addons-css-transition-group@15.x
  • react-addons-css-transition-group@15.6.0
    added 1 package in 1.29s
    PS D:\tools\adelin\adelin> npm install react-addons-linked-state-mixin@15.x
  • react-addons-linked-state-mixin@15.6.0
    added 1 package in 1.63s
    PS D:\tools\adelin\adelin> npm install react-addons-create-fragment@15.x
  • react-addons-create-fragment@15.6.0
    added 1 package in 1.447s
    PS D:\tools\adelin\adelin> npm install eact-addons-update@15.x
    npm ERR! code E404
    npm ERR! 404 Not Found: eact-addons-update@15.x

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Markum\AppData\Roaming\npm-cache_logs\2017-07-21T12_52_42_669Z-debug.log
PS D:\tools\adelin\adelin> npm install react-addons-test-utils@15.x

  • react-addons-test-utils@15.6.0
    added 1 package in 1.248s
    PS D:\tools\adelin\adelin> npm install react-addons-update@15.x
  • react-addons-update@15.6.0
    added 1 package in 1.259s
    PS D:\tools\adelin\adelin> npm install react-addons-perf@15.x
  • react-addons-perf@15.4.2
    added 1 package in 1.155s
    PS D:\tools\adelin\adelin> meteor run
    [[[[[ ~\D\tools\adelin\adelin ]]]]]

=> Started proxy.
=> Started MongoDB.
W20170721-15:54:16.659(3)? (STDERR) Warning: ReactTestUtils has been moved to react-dom/test-utils. Update references to remove this warning.
=> Started your app.

=> App running at: http://localhost:3000/