-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Storybook fails to boot with TypeError
when it can't write to node_modules
#9696
Comments
@gaetanmaisse are you looking at this in the context of |
@shilman thanks for the help! For some added context here, I'm not using Do you know why the Please let me know if I can give you any more info that might help! |
@agconti I brought up |
@shilman you're 💯right, with Yarn 2 dependencies are read-only:
@agconti I'm currently working on making SB compatible with Yarn 2 (#9667), to do so I moved webpack's output from In your case, the error is already about |
@gaetanmaisse thanks for your response! Unfortunately, I can't make As a workaround I've tried making the directories you specified, Here's the updated commit in my example repo that reproduces this error: Here's where those directories are made writable: version: '3'
services:
storybook:
build: .
restart: always
command: npm run storybook
ports:
- "3000:3000"
volumes:
- .:/app
# storybook fails to load because it cant create a file here
# uncomment this link to see it succeed
- /app/node_modules
- ./node_modules/.cache:/app/node_modules/.cache
- ./node_modules/@storybook/core/:/app/node_modules/@storybook/core/ Here's confirmation that files are actually being written to those dirs: Do you know if I need to make any additional directories writable? |
I'm a docker newbie so my question is maybe irrelevant but why not use Dockerfile: ...
COPY --chown=node:node . .
... docker-compose: version: '3'
services:
storybook:
build: .
restart: always
command: npm run storybook
ports:
- "3000:3000"
volumes:
- .:/app |
@gabrielcsapo you're right! that was the problem. Removing the Thanks so much for helping me solve this problem! 💖 |
Also thanks @gaetanmaisse 😈 |
Describe the bug
Storybook fails to compile files and start the development server with the following error when its unable to write to the
node_modules
folder. When it's able to write to thenode_modules
folder it succeeds.Error:
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/agconti/storybook-node-modules-in-docker-compose-failure
docker-compose up
node_modules
volume mount. (( this makesnode_modules
writable ))docker-compose up
and see that it succeeds in starting upExpected behavior
I should be able to start the project without giving write access to my
node_modules
folder.Screenshots
Code snippets
System:
The text was updated successfully, but these errors were encountered: