Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Cannot find module 'invariant' #717

Closed
donpinkus opened this issue Dec 16, 2015 · 5 comments
Closed

Error: Cannot find module 'invariant' #717

donpinkus opened this issue Dec 16, 2015 · 5 comments

Comments

@donpinkus
Copy link

I am getting this error when running npm run dev after cloning the project:

[piping] can't execute file: /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/bin/server.js
[1] [piping] error given was: Error: Cannot find module 'invariant'
[1]     at Function.Module._resolveFilename (module.js:336:15)
[1]     at Function._module3.default._resolveFilename (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:403:34)
[1]     at Function.module._load (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/piping/lib/launcher.js:24:23)
[1]     at Module.require (module.js:365:17)
[1]     at require (module.js:384:17)
[1]     at Object.<anonymous> (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/redux-router/node_modules/history/lib/createMemoryHistory.js:9:18)
[1]     at Module._compile (module.js:460:26)
[1]     at Module._extensions..js (module.js:478:10)
[1]     at require.extensions.(anonymous function) (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/babel-core/lib/api/register/node.js:214:7)
[1]     at Object._module3.default._extensions.(anonymous function) [as .js] (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:250:71)
[1] [piping] further repeats of this error will be suppressed...

Here is the full output of npm run dev. I ran npm install immediately before this without any errors.

Donalds-MacBook:react-redux-universal-hot-example-master · npm run dev

> react-redux-universal-hot-example@0.9.0 dev /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
> concurrent --kill-others "npm run watch-client" "npm run start-dev" "npm run start-dev-api"

[0] 
[0] > react-redux-universal-hot-example@0.9.0 watch-client /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[0] > better-npm-run watch-client
[0] 
[2] 
[2] > react-redux-universal-hot-example@0.9.0 start-dev-api /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[2] > better-npm-run start-dev-api
[2] 
[1] 
[1] > react-redux-universal-hot-example@0.9.0 start-dev /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[1] > better-npm-run start-dev
[1] 
[0] running better-npm-run in /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[1] running better-npm-run in /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[0] Executing script: watch-client
[0] 
[0] to be executed: node webpack/webpack-dev-server.js
[2] running better-npm-run in /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master
[1] Executing script: start-dev
[1] 
[1] to be executed: node ./bin/server.js
[2] Executing script: start-dev-api
[2] 
[2] to be executed: node ./bin/api.js
[0] ==> 🚧  Webpack development server listening on port 3001
[2] ----
[2] ==> 🌎  API is running on port 3030
[2] ==> 💻  Send requests to http://localhost:3030
[1] [piping] can't execute file: /Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/bin/server.js
[1] [piping] error given was: Error: Cannot find module 'invariant'
[1]     at Function.Module._resolveFilename (module.js:336:15)
[1]     at Function._module3.default._resolveFilename (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:403:34)
[1]     at Function.module._load (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/piping/lib/launcher.js:24:23)
[1]     at Module.require (module.js:365:17)
[1]     at require (module.js:384:17)
[1]     at Object.<anonymous> (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/redux-router/node_modules/history/lib/createMemoryHistory.js:9:18)
[1]     at Module._compile (module.js:460:26)
[1]     at Module._extensions..js (module.js:478:10)
[1]     at require.extensions.(anonymous function) (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/babel-core/lib/api/register/node.js:214:7)
[1]     at Object._module3.default._extensions.(anonymous function) [as .js] (/Users/donaldpinkus/Desktop/react-redux-universal-hot-example-master/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:250:71)
[1] [piping] further repeats of this error will be suppressed...
[0] Hash: d180dedaf2d5bc95580f
[0] Version: webpack 1.12.9
[0] Time: 12028ms
[0]                                  Asset     Size  Chunks             Chunk Names
[0] db812d8a70a4e88e888744c1c9a27e89.woff2  66.6 kB          [emitted]  
[0]   f4769f9bdb7466be65088239c12046d1.eot  20.1 kB          [emitted]  
[0]  fa2772327f55d8198301fdb8bcfc8158.woff  23.4 kB          [emitted]  
[0]   e18bbf611f2a2e43afc071aa2f4e1512.ttf  45.4 kB          [emitted]  
[0]   89889688147bd7575d6327160d64e760.svg   109 kB          [emitted]  
[0]   32400f4e08932a94d8bfd2422702c446.eot  70.8 kB          [emitted]  
[0] 448c34a56d699c29117adc64c43affeb.woff2    18 kB          [emitted]  
[0]  a35720c2fed2c7f043bc7e4ffb45e073.woff  83.6 kB          [emitted]  
[0]   a3de2170e4e9df77161ea5d3f31b2668.ttf   142 kB          [emitted]  
[0]   f775f9cca88e21d45bebe185b27c0e5b.svg   366 kB          [emitted]  
[0]   c29770d03d2e95e3ea5899d57c6cfeab.jpg  92.2 kB          [emitted]  
[0]           main-d180dedaf2d5bc95580f.js  7.03 MB       0  [emitted]  main
[0] webpack built d180dedaf2d5bc95580f in 12028ms
@grigio
Copy link

grigio commented Dec 16, 2015

+1
I've (temporary) fixed it with npm install invariant warning --save

@quicksnap
Copy link
Collaborator

Hm.. are there any peer dependency errors on a clean npm install? What's referencing invariant?

@donpinkus
Copy link
Author

@quicksnap doesn't look like there are any errors on a clean npm install.

There are a lot of node_modules that require 'invariant'. This particular error seems to be coming from node_modules/redux-router/node_modulex/history/lib/createMemoryHistory.js

@donpinkus
Copy link
Author

cloned the latest version of the repo. npm install works now

Feel free to close :)

@quicksnap
Copy link
Collaborator

Sweeet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants