【问题标题】:Renaming '_next' to 'next' in the out directory: NextJS在 out 目录中将“_next”重命名为“next”:NextJS
【发布时间】:2022-06-16 21:18:47
【问题描述】:

我正在构建 NextJS chrome 扩展,我面临的问题是,当我“加载解压”扩展时,它说“无法加载带有文件或目录名称 _next 的扩展。以 _ 开头的文件名被保留供系统使用。"

我在网上查了一些解决方案,上面说将 '_next' 重命名为 'next',然后将 'out' 目录中的所有 '_next' 更改为 'next' 应该可以。

上述任务的命令是

rm -rf .next/ out/
rm extension.zip 
npm run build
npm run export 
mv ./out/_next ./out/next
cd ./out && grep -rli '_next' * | xargs -I@ sed -i '' 's/_next/next/g' @ 
zip -r -FS ../my-extension.zip *

我已经检查了上述命令,但它改变了我的样式,之后路由就不起作用了。

在将 '_next' 更改为 'next' 之前,我的扩展程序在浏览器中看起来像这样

在“out”目录中将“_next”移动到“next”后,

mv ./out/_next ./out/next

我的扩展在浏览器中看起来像这样。

注意:我知道我必须将“out”目录中包含“_next”的所有块更改为“next”,但我不知道该怎么做,因为当我跑步时

cd ./out && grep -rli '_next' * | xargs -I@ sed -i '' 's/_next/next/g' @

它给我的输出是:

$ cd ./out && grep -rli '_next' * | xargs -I@ sed -i '' 's/_next/next/g' @
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory
sed: can't read s/_next/next/g: No such file or directory

请指导我,如何在此目录中将所有 '_next*' 重命名为 'next*'。

感谢您的宝贵时间。

【问题讨论】:

  • 您尝试了什么,什么有效,什么无效?
  • 我想使用滑动窗口技术找到如上所示的子集
  • 这不是我要求的,我们不是来为您编码,而是在您遇到问题时为您提供帮助

标签: javascript reactjs next.js


猜你喜欢
  • 1970-01-01
  • 2012-12-27
  • 2017-05-18
  • 2011-12-12
  • 2018-11-29
  • 2012-03-13
  • 2016-07-15
  • 1970-01-01
  • 2013-01-31
相关资源
最近更新 更多