CRXJS错误:运行chrome扩展时路径包含无效字符

92dk7w1h  于 2023-08-01  发布在  Go
关注(0)|答案(1)|浏览(193)

我从this site克隆了chrome扩展quickstart,但是在安装依赖项(使用yarn)后无法运行它。我通过NVM使用Node 16,因为Node-Gyp在Node 18上出现了一些安装错误。当我运行“yarn dev”时,我在Vite初始化本地dev服务器后得到以下输出:

PS C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3> yarn dev
yarn run v1.22.19
warning ..\package.json: No license field
$ run-s clean && vite
warning ..\package.json: No license field
$ run-p clean:*
warning ..\package.json: No license field
warning ..\package.json: No license field
$ rimraf dist
$ rimraf dist-firefox-v2

  VITE v4.3.9  ready in 881 ms        

  ➜  Local:   http://127.0.0.1:5173/  
  ➜  Network: use --host to expose    
  ➜  press h to show help
C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\utils.js:16   
      const error = new Error(`Path contains invalid characters: ${pth}`)   
                    ^

Error: Path contains invalid characters: C:/Users/kking/OneDrive/Documents/code/Client Projects/refine3/refine-v3/src/C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\dist/content
    at checkPath (C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\utils.js:16:21)
    at Object.module.exports.makeDir (C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\mkdirs\make-dir.js:12:3)
    at Object.defineProperty.value (C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\universalify\index.js:22:13)  
    at C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\@crxjs\vite-plugin\node_modules\fs-extra\lib\output-file\index.js:20:11
    at C:\Users\kking\OneDrive\Documents\code\Client Projects\refine3\refine-v3\node_modules\universalify\index.js:22:54 {
  code: 'EINVAL'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

字符串
我最初认为这个问题是由于从OneDrive同步文件夹运行,所以我从不同的文件夹运行它,但结果相同。我已经浏览了CRXJS的repo,Vite的repo和这个快速入门的repo上的问题,但没有找到任何提到这个问题的发布问题。repo

jei2mxaa

jei2mxaa1#

对于任何人从未来查看此,不要使用该网站的“快速入门”模板。只需遵循CRXJS官方文档here

相关问题