首页 > 解决方案 > 安装了故事书,它不会安装错误说 npm 有问题

问题描述

我正在尝试将 storybook 安装到我的 react 应用程序中,但出现以下错误:

npx -p @storybook/cli sb init
Unhandled rejection Error: EACCES: permission denied, open '/Users/angelainniss/.npm/_cacache/index-v5/33/e5/eafd5bb0479b018922b7ac494f7089e5941f5d3050e7b4f78e2cb97358c7'

npm ERR! cb() never called!

npm ERR! This is an error with npm itself. Please report this error at:
npm ERR!     <https://npm.community>

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/myname/.npm/_logs/2020-10-15T15_39_36_166Z-debug.log
Install for @storybook/cli@latest failed with code 1

谁能指出我正确的方向,这可能是什么?

我做了以下事情:

  1. 创建了一个新的 React 应用程序
  2. 在 package.json 的脚本下添加了这一行:"storybook": "start-storybook -p 9001"
  3. 跑了npx -p @storybook/cli sb init

标签: reactjsnpmyarnpkgstorybook

解决方案


推荐阅读