You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on two projects at the same time, both generated with create-react-app. One exports a React component that's used by the other, so I'd like create a symlink between the two. I ran npm link within the master project and then npm link mapbook (where mapbook is the name of the project) in the client. Then in index.js for the client I have:
import Mapbook from 'mapbook'
Expected behavior
When I run npm run start, I'm expecting the module to be imported without any errors.
Actual behavior
Instead I get:
Error in ./src/index.js
Module not found: 'mapbook' in /home/ubuntu/workspace/atlas-mapbook/src
Not sure why it's not seeing the symlink in node_modules. If I change the import/export statements to CommonJS and simply node index.js it works fine, so I don't think it's a permissions issue.
Environment
Run these commands in the project folder and fill in their results:
There is no good support for npm link workflow at the moment.
There are a few issues about this and we’ll need to consider a holistic solution at some point.
Can you reproduce the problem with latest npm?
Yes. I'm on Node 7.2.0, npm 3.10.9.
Description
I'm working on two projects at the same time, both generated with
create-react-app
. One exports a React component that's used by the other, so I'd like create a symlink between the two. I rannpm link
within the master project and thennpm link mapbook
(wheremapbook
is the name of the project) in the client. Then inindex.js
for the client I have:Expected behavior
When I run
npm run start
, I'm expecting the module to be imported without any errors.Actual behavior
Instead I get:
Not sure why it's not seeing the symlink in
node_modules
. If I change theimport
/export
statements to CommonJS and simplynode index.js
it works fine, so I don't think it's a permissions issue.Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected):atlas-mapbook@0.1.0 /home/ubuntu/workspace/atlas-mapbook
└── react-scripts@0.7.0
node -v
:v7.2.0
npm -v
:3.10.9
Then, specify:
Reproducible Demo
https://github.com/rbrtmrtn/create-react-app-issue
Thanks for any suggestions!
The text was updated successfully, but these errors were encountered: