我对本机项目的设置和打字稿反应良好。所有故事都在设备上运行。但是问题在于故事书服务器未运行。
已遵循Storybook for React Native的所有步骤,并且故事已正确加载到设备上。但是当我运行命令storybook start
时会产生错误。
myAPP_PATH/node_modules/enhanced-resolve/lib/Resolver.js:254
const idxQuery = identifier.indexOf("?");
^
TypeError: identifier.indexOf is not a function
at Resolver.parse (myAPP_PATH/node_modules/enhanced-resolve/lib/Resolver.js:254:31)
at resolver.getHook.tapAsync (myAPP_PATH/node_modules/enhanced-resolve/lib/ParsePlugin.js:16:28)
at AsyncSeriesBailHook.eval [as callAsync] (eval at create (myAPP_PATH/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
at Resolver.doResolve (myAPP_PATH/node_modules/enhanced-resolve/lib/Resolver.js:235:16)
at resolver.getHook.tapAsync (myAPP_PATH/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:34:13)
at AsyncSeriesBailHook.eval [as callAsync] (eval at create (myAPP_PATH/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
at Resolver.doResolve (myAPP_PATH/node_modules/enhanced-resolve/lib/Resolver.js:235:16)
at resolver.getHook.tapAsync (myAPP_PATH/node_modules/enhanced-resolve/lib/AliasFieldPlugin.js:43:13)
at AsyncSeriesBailHook.eval [as callAsync] (eval at create (myAPP_PATH/node_modules/tapable/lib/HookCodeFactory.js:32:10), <anonymous>:7:1)
at Resolver.doResolve (myAPP_PATH/node_modules/enhanced-resolve/lib/Resolver.js:235:16)
at DescriptionFileUtils.loadDescriptionFile (myAPP_PATH/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:38:14)
at forEachBail (myAPP_PATH/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:51:12)
at args (myAPP_PATH/node_modules/enhanced-resolve/lib/forEachBail.js:30:14)
at onJson (myAPP_PATH/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:42:5)
at resolver.fileSystem.readJson (myAPP_PATH/node_modules/enhanced-resolve/lib/DescriptionFileUtils.js:19:6)
at process.nextTick (myAPP_PATH/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:73:15)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! MyProject@0.0.3 storybook: `storybook start "start"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the MyProject@0.0.3 storybook script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! xyz/2019-01-12T06_39_40_736Z-debug.log