NPM模块突然丢失:React和React-DOM

时间:2017-11-15 22:01:13

标签: reactjs npm

所以,我一直在我的本地运行这个React / Redux应用程序。 Webpack一直在观看节点正在侦听端口3000.

今天上班了,没问题。我安装了这个:https://www.npmjs.com/package/react-live-clock

在我这样做之后,我回去重新加载应用程序,我收到了关于React的npm模块中缺少文件的错误。所以我去看了终端的Webpack输出,发现了这个可爱的堆栈跟踪:

ERROR in ./node_modules/react-dom/lib/ReactCompositeComponent.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactCompositeComponent.js 14:12-38
 @ ./node_modules/react-dom/lib/instantiateReactComponent.js
 @ ./node_modules/react-dom/lib/ReactMount.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactMount.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactMount.js 15:12-38
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/LinkedValueUtils.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/LinkedValueUtils.js 16:12-38
 @ ./node_modules/react-dom/lib/ReactDOMTextarea.js
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactNodeTypes.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactNodeTypes.js 14:12-38
 @ ./node_modules/react-dom/lib/getHostComponentFromComposite.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactDOMOption.js
Module not found: Error: Can't resolve 'react/lib/React' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactDOMOption.js 13:12-38
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/checkReactTypeSpec.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/checkReactTypeSpec.js 27:27-70 69:37-80
 @ ./node_modules/react-dom/lib/ReactCompositeComponent.js
 @ ./node_modules/react-dom/lib/instantiateReactComponent.js
 @ ./node_modules/react-dom/lib/ReactMount.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactDOMInvalidARIAHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactDOMInvalidARIAHook.js 12:29-72
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactDebugTool.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactDebugTool.js 14:29-72
 @ ./node_modules/react-dom/lib/ReactInstrumentation.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactChildReconciler.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactChildReconciler.js 27:27-70 35:31-74
 @ ./node_modules/react-dom/lib/ReactMultiChild.js
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/flattenChildren.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/flattenChildren.js 24:27-70 40:33-76
 @ ./node_modules/react-dom/lib/ReactMultiChild.js
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactDOMUnknownPropertyHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactDOMUnknownPropertyHook.js 13:29-72
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactDOMNullInputValuePropHook.js
Module not found: Error: Can't resolve 'react/lib/ReactComponentTreeHook' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactDOMNullInputValuePropHook.js 11:29-72
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactMultiChild.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactMultiChild.js 17:24-62
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/findDOMNode.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/findDOMNode.js 13:24-62
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactMount.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactMount.js 17:24-62
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactCompositeComponent.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactCompositeComponent.js 16:24-62
 @ ./node_modules/react-dom/lib/instantiateReactComponent.js
 @ ./node_modules/react-dom/lib/ReactMount.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/ReactUpdateQueue.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/ReactUpdateQueue.js 13:24-62
 @ ./node_modules/react-dom/lib/ReactMount.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/traverseAllChildren.js
Module not found: Error: Can't resolve 'react/lib/ReactCurrentOwner' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/traverseAllChildren.js 13:24-62
 @ ./node_modules/react-dom/lib/flattenChildren.js
 @ ./node_modules/react-dom/lib/ReactMultiChild.js
 @ ./node_modules/react-dom/lib/ReactDOMComponent.js
 @ ./node_modules/react-dom/lib/ReactDefaultInjection.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

ERROR in ./node_modules/react-dom/lib/instantiateReactComponent.js
Module not found: Error: Can't resolve 'react/lib/getNextDebugID' in '/Users/path/toProject/node_modules/react-dom/lib'
 @ ./node_modules/react-dom/lib/instantiateReactComponent.js 18:21-56
 @ ./node_modules/react-dom/lib/ReactMount.js
 @ ./node_modules/react-dom/lib/ReactDOM.js
 @ ./node_modules/react-dom/index.js
 @ ./app/index.js

我确认他们确实突然失踪了。所以,我重新安装了反应和反应。没有骰子。我继续前进并卸载了时钟npm。

如果有人有任何指针/技巧/提示/建议,这将是惊人的。我宁愿不用新安装的React来重新创建这个项目。

干杯!

0 个答案:

没有答案