Publish to chromatic doesn't work on NPM 7
See original GitHub issue@anthony-hull wrote (npm 7.5.3):
I was getting an empty build folder and it was hanging on the build stage.
downgrading to npm install -g npm@next-6
fixed the build stage
In https://github.com/chromaui/chromatic-cli/issues/299, Ky6uk wrote:
Running npm run build-storybook
manually works correctly, but npm run chromatic
just hanging out after some timeout on build-storybook
step.
- Node.js:
15.10
- NPM:
7.6.0
- Chromatic:
5.6.3
- Storybook
6.1.21
Starting: build-storybook -- --output-dir /tmp/chromatic--34-bm7FCFVqGuuV
node:internal/modules/cjs/loader:926
throw err;
^
Error: Cannot find module '/builds/company/webapp/storybook/build-storybook'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:923:15)
at Function.Module._load (node:internal/modules/cjs/loader:768:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
→ Command failed: build-storybook -- --output-dir /tmp/chromatic--34-bm7FCFVqGuuV
┆Issue is synchronized with this Asana task by Unito
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:9 (2 by maintainers)
Top Results From Across the Web
Setup • Chromatic docs
Setup and publish Storybook. The Chromatic CLI builds then publishes Storybook to a secure workspace in the cloud. That allows your team to...
Read more >Chromatic Addon | Storybook: Frontend workshop for UI ...
Publishes your Storybook to Chromatic and kicks off tests if they're enabled. Published on npm Tested with Chromatic. Documentation. Read the Chromatic CLI ......
Read more >Storybook-chromatic NPM - npm.io
Chromatic CLI. Publishes your Storybook to Chromatic and kicks off tests if they're enabled. Install. yarn add chromatic. Usage.
Read more >Chromatic CLI not building storybook - Stack Overflow
It worked the first time and then hangs on subsequent attempts. ➜ my-project git:(storybook-poc) ✗ yarn chromatic yarn run v1.22.10 $ npx ...
Read more >storybook-chromatic | Yarn - Package Manager
Chromatic CLI. Publishes your Storybook to Chromatic and kicks off tests if they're enabled. ... FIX setting the fromCI flag from our github...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apparently, it works if calling chromatic from local package instead of using npx: See this other’s issue comment.
I guess the issue is how npx with npm >= 7.0 runs chromatic in a different way.
Summarizing the workaround:
npm i -D chromatic
Instead of
"chromatic": "npx chromatic --project-token <your-token>"
put"chromatic": "chromatic --project-token <your-token>"
Yes I was. I had run npx sb@latest upgrade before and I checked the version number against NPM for this project.