我正在将Chrome扩展移植到火狐WebExtensions。在Chrome上一切都很好。
我在Firefox上尝试过这些:
1.修改我的扩展使其与火狐WebExtensions兼容,然后通过Load Temporary Add-on将其加载到火狐中,一切正常。
2.通过npm install -g web-ext安装web-ext模块。然后我运行web-ext run,火狐成功地启动了我的扩展安装。
3.运行 web-ext build,然后在火狐上安装打包的扩展,一切都正常。
D:\temp>web-ext build
Building web extension from D:\temp
Your web extension is ready: D:\temp\web-ext-artifacts\my_extension-1.0.zip4.然后运行web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret,它出错了:
D:\temp>web-ext sign --api-key=MyApiKey --api-secret=MyApiSecret
Building web extension from D:\temp
sign: Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX'
at Error (native)
at Object.fs.rmdirSync (fs.js:806:18)
at _rmdirRecursiveSync (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:284:10)
at TempDir._cleanupCallback [as _removeTempDir] (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\node_modules\tmp\lib\tmp.js:408:5)
at TempDir.remove (C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:4939)
at C:\Users\abc\AppData\Roaming\npm\node_modules\web-ext\dist\webpack:\src\util\temp-dir.js:9:3976
at process._tickCallback (node.js:401:9)
sign: Error code: ENOTEMPTY我进入了C:\Users\abc\AppData\Local\Temp\tmp-web-ext-628J9dJMBi0bWRX,实际上它是空的。有人知道为什么会这样吗?
我的api密钥和api秘密是为旧火狐JSCTypes加载项。这就是我不断犯错误的原因吗?
这是网页文稿。
发布于 2017-01-18 07:07:58
这个问题的解决方案
经过进一步的挖掘,我发现导致这个错误的原因是我在我的网络上使用了代理。我试图通过运行命令set HTTP_PROXY=MyProxyServerAddress来设置代理,然后错误就消失了。
其他故障解决
然后我再次尝试运行web-ext sign,发现了另一个错误:
Server response: You do not own this addon. (status: 403)
sign: WebExtError: The WebExtension could not be signed我将我的外接程序(web-ext build生成的包)上传到Mozilla插件站点,然后再次运行web-ext sign。这一次外接程序成功地签署了。
注意:,每次运行
web-ext sign时,您都需要更改插件的版本。否则,它将因错误而失败:Server response: Version already exists. (status: 409)
Cheers!
https://stackoverflow.com/questions/41693257
复制相似问题