加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

reactjs – 撤消’npm run eject’的反应

发布时间:2020-12-15 16:21:39 所属栏目:百科 来源:网络整理
导读:我试图用反应CDN脚本来测试我的React应用程序(使用create-react-app创建)的性能,然后我做了’npm run eject’来添加 webpack externals依赖项反应和反应. ? 我在webpack配置和 script中轻松完成了在index.html中 ...externals: { react: 'React','react-dom'
我试图用反应CDN脚本来测试我的React应用程序(使用create-react-app创建)的性能,然后我做了’npm run eject’来添加 webpack externals依赖项反应和反应.
?
我在webpack配置和< script>中轻松完成了在index.html中

...
externals: {
    react: 'React','react-dom':'ReactDOM'
},...

现在我想将它恢复到以前的状态

我正在使用git,我在一个单独的分支中进行了这个实验.

我跑了git checkout master和npm start

结果很烦人

> myapp@0.18.1 start /home/code/serverSync/myapp/ui
> react-scripts start

sh: 1: react-scripts: not found

npm ERR! Linux 4.15.0-23-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! myapp@0.18.1 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the myapp@0.18.1 start script 'react-scripts start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do,this is most likely a problem with the myapp package,npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     react-scripts start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs myapp
npm ERR! Or if that isn't available,you can get their info via:
npm ERR!     npm owner ls myapp
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/code/serverSync/myapp/ui/npm-debug.log

我怎样才能恢复到主分支?

解决方法

如果您现在处于主分支(哪个配置与npm run eject之前相同),请尝试以下操作.

>删除node_module> npm安装> npm开始

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读