Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

Cannot resolve module 'react-router' #77

Closed
pdehaan opened this issue Feb 9, 2016 · 3 comments
Closed

Cannot resolve module 'react-router' #77

pdehaan opened this issue Feb 9, 2016 · 3 comments
Assignees
Milestone

Comments

@pdehaan
Copy link
Collaborator

pdehaan commented Feb 9, 2016

I believe that #70 caused a slight issue with the build.

I did a fresh git clone and npm start and get the following output.
I believe this is due to changing the dependencies in package.json but not updating the npm-shrinkwrap.json file.

$ npm start

> activity-streams@0.0.1 start /Users/pdehaan/dev/github/activity-streams
> npm-run-all --parallel start:*

...

Hash: 864977f28f400c140287
Version: webpack 1.12.13
Time: 1822ms
    Asset    Size  Chunks             Chunk Names
bundle.js  795 kB       0  [emitted]  main
    + 193 hidden modules

ERROR in ./content-src/components/Routes/Routes.js
Module not found: Error: Cannot resolve module 'react-router' in /Users/pdehaan/dev/github/activity-streams/content-src/components/Routes
 @ ./content-src/components/Routes/Routes.js 5:15-38

ERROR in ./content-src/components/Routes/Routes.js
Module not found: Error: Cannot resolve module 'history' in /Users/pdehaan/dev/github/activity-streams/content-src/components/Routes
 @ ./content-src/components/Routes/Routes.js 11:16-34

ERROR in ./content-src/components/Header/Header.js
Module not found: Error: Cannot resolve module 'react-router' in /Users/pdehaan/dev/github/activity-streams/content-src/components/Header
 @ ./content-src/components/Header/Header.js 5:15-38

Workaround:

Install the dependencies from the package.json directly instead of the cached npm-shrinkwrap.json file.

$ rm -rf node_modules npm-shrinkrap.json && npm i && npm start

I wasn't sure if you were adding devDependencies to the npm-shrinkwrap.json file. I tried with and without, but it looks like the current npm-shrinkwrap.json file was generated using npm@3 versus trusty old npm@2, so i'm seeing a great big diff-tastrophe.

@rlr
Copy link
Contributor

rlr commented Feb 10, 2016

I was getting this same error and fixed it by upgrading npm to latest. Not sure if we need or want to support npm 2...

@k88hudson
Copy link
Contributor

Yes, seems like npm-shrinkwrap needs to be updated!

@k88hudson k88hudson self-assigned this Feb 10, 2016
@k88hudson k88hudson added this to the 1. UI Demo milestone Feb 10, 2016
@k88hudson
Copy link
Contributor

Arg, I'm tempted to say for now we shouldn't support npm 2 for now, since we're not actually running a separate matrix for it and I don't think it's worth adding build time to travis

k88hudson added a commit that referenced this issue Feb 10, 2016
chore(npm): #77 Update npm-shrinkwrap.json
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants