question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

sb init fails with error code 1 in the app created with ng new version 11

See original GitHub issue

Describe the bug Running npx sb init on a new app created with ng new app fails with error code 1.

To Reproduce

  1. Create a new app with ng new app
  2. Run npx sb init in the app.

Expected behavior Storybook initializes successfully.

Screenshots

Code snippets

> node --version
v15.5.1
> ng --version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.0.7
Node: 15.5.1
OS: darwin x64

Angular: 11.0.9
... animations, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.7
@angular-devkit/build-angular   0.1100.7
@angular-devkit/core            11.0.7
@angular-devkit/schematics      11.0.7
@angular/cli                    11.0.7
@schematics/angular             11.0.7
@schematics/update              0.1100.7
rxjs                            6.6.3
typescript                      4.0.5
> ng new angular-eleven-app
...
✔ Packages installed successfully.
    Successfully initialized git.
> cd angular-eleven-app
> npx sb init

 sb init - the simplest way to add a Storybook to your project. 

 • Detecting project type. ✓
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-actions@6.1.14
npm WARN   node_modules/@storybook/addon-actions
npm WARN     dev @storybook/addon-actions@"^6.1.14" from the root project
npm WARN     1 more (@storybook/addon-essentials)
npm WARN   8 more (@storybook/addon-essentials, @storybook/addon-links, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^16.8.4" from react-inspector@5.1.0
npm WARN node_modules/react-inspector
npm WARN   react-inspector@"^5.0.1" from @storybook/addon-actions@6.1.14
npm WARN   node_modules/@storybook/addon-actions
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@17.0.1
npm WARN node_modules/react
npm WARN   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-actions@6.1.14
npm WARN   node_modules/@storybook/addon-actions
npm WARN     dev @storybook/addon-actions@"^6.1.14" from the root project
npm WARN     1 more (@storybook/addon-essentials)
npm WARN   8 more (@storybook/addon-essentials, @storybook/addon-links, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/@reach/router
npm WARN   @reach/router@"^1.3.3" from @storybook/api@6.1.14
npm WARN   node_modules/@storybook/api
npm WARN   1 more (@storybook/router)
npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   peerOptional react-dom@"^16.8.0 || ^17.0.0" from @storybook/addon-actions@6.1.14
npm WARN   node_modules/@storybook/addon-actions
npm WARN     dev @storybook/addon-actions@"^6.1.14" from the root project
npm WARN     1 more (@storybook/addon-essentials)
npm WARN   7 more (@storybook/addon-essentials, @storybook/addon-links, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"15.x || 16.x || 16.4.0-alpha.0911da3" from @reach/router@1.3.4
npm WARN node_modules/@reach/router
npm WARN   @reach/router@"^1.3.3" from @storybook/api@6.1.14
npm WARN   node_modules/@storybook/api
npm WARN   1 more (@storybook/router)
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-actions@6.1.14
npm ERR!   node_modules/@storybook/addon-actions
npm ERR!     dev @storybook/addon-actions@"^6.1.14" from the root project
npm ERR!     @storybook/addon-actions@"6.1.14" from @storybook/addon-essentials@6.1.14
npm ERR!     node_modules/@storybook/addon-essentials
npm ERR!       dev @storybook/addon-essentials@"^6.1.14" from the root project
npm ERR!   peerOptional react@"^16.8.0 || ^17.0.0" from @storybook/addon-essentials@6.1.14
npm ERR!   node_modules/@storybook/addon-essentials
npm ERR!     dev @storybook/addon-essentials@"^6.1.14" from the root project
npm ERR!   7 more (@storybook/addon-links, @storybook/addons, react-dom, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.3.0
npm ERR! node_modules/@reach/router/node_modules/create-react-context
npm ERR!   create-react-context@"0.3.0" from @reach/router@1.3.4
npm ERR!   node_modules/@reach/router
npm ERR!     @reach/router@"^1.3.3" from @storybook/api@6.1.14
npm ERR!     node_modules/@storybook/api
npm ERR!       @storybook/api@"6.1.14" from @storybook/addon-actions@6.1.14
npm ERR!       node_modules/@storybook/addon-actions
npm ERR!       2 more (@storybook/addon-essentials, @storybook/addons)
npm ERR!     1 more (@storybook/router)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /Users/costar/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/costar/.npm/_logs/2021-01-20T16_00_28_569Z-debug.log
An error occurred while installing dependencies.

npm ERR! code 1
npm ERR! path /Users/costar/personal/angular-eleven-app
npm ERR! command failed
npm ERR! command sh -c sb init

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/costar/.npm/_logs/2021-01-20T16_00_28_646Z-debug.log

System

Environment Info:

  System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
  Binaries:
    Node: 15.5.1 - ~/.nvm/versions/node/v15.5.1/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v15.5.1/bin/yarn
    npm: 7.3.0 - ~/.nvm/versions/node/v15.5.1/bin/npm
  Browsers:
    Chrome: 87.0.4280.141
    Firefox: 84.0.2
    Safari: 13.1.3

Additional context

Angular CLI: 11.0.7 node: v15.5.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
shilmancommented, Jan 25, 2021

This appears to be an issue with NPM7. We’ll investigate. In the meantime can you use NPM6 as a workaround?

2reactions
adarshsrivastava11commented, Jan 21, 2021

Facing the same issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Storybook to Angular v10 Project - Stack Overflow
npx sb init seems to install storybook at v6.4. As a test, I tried creating a quick angular project ( ng new )...
Read more >
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:216958 - "python module in sys-apps/file-4.23 built via distutils fails while cross-compiling" status:RESOLVED resolution:OBSOLETE severity:normal ...
Read more >
Npm install command failing with message "could not find ...
I was following the project setup. When I run the npm install command, npm starts downloading the dependencies. But then, suddenly, it stops ......
Read more >
Release Notes for Cisco Identity Services Engine, Release 3.1
For each NDG you choose, a new Authorization Result alarm is created. ... In Cisco ISE Release 3.1, EAP-TLS authentication might fail for...
Read more >
Node.js v19.3.0 Documentation
Indicates the failure of an assertion. All errors thrown by the node:assert module will be instances of the AssertionError class. new assert.AssertionError( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found