我正在使用VueJS构建一个应用程序,我想将支付处理器与SolanaPay集成。我在安装SolanaPay包时一无所获,因为当我试图导入它时,它会给我这个错误。
ERROR Failed to compile with 3 errors 16:41:22 ч.
These dependencies were not found:
* @solana/web3.js in ./node_modules/@solana/buffer-layout-utils/lib/esm/web3.mjs, ./node_modules/@solana/pay/lib/esm/constants.mjs
我很确定这是Vue/Webpack
的问题,因为当我尝试安装这些包时——@solana/web3.js
&@solana/pay
在纯Javascript项目上工作。我还尝试从vue-cli-service
中删除@
别名,但没有成功。
package.json
{
"name": "test_project",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@solana/pay": "^0.1.3",
"@solana/web3.js": "^1.36.0",
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuetify": "^2.6.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.5.15",
"@vue/cli-plugin-eslint": "~4.5.15",
"@vue/cli-plugin-router": "~4.5.15",
"@vue/cli-service": "~4.5.15",
"babel-eslint": "^10.1.0",
"eslint": "^6.7.2",
"eslint-plugin-vue": "^6.2.2",
"sass": "~1.32.0",
"sass-loader": "^10.0.0",
"vue-cli-plugin-vuetify": "~2.4.7",
"vue-template-compiler": "^2.6.11",
"vuetify-loader": "^1.7.0"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"parserOptions": {
"parser": "babel-eslint"
},
"rules": {}
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
问题出在我有@solana/web3.js@1.36.0
的包版本上,但当我安装@solana/web3.js@1.32.0
时,它得到了修复。