此版本的µWS与您的Node.js版本不兼容:错误:node-loader.当运行“truffle console”时

iqih9akk  于 2023-04-20  发布在  Node.js
关注(0)|答案(1)|浏览(335)

我正在做一个区块链项目,我使用Truffle。当我运行Truffle控制台命令时,我遇到了这个问题。
完整日志:
此版本的µWS与您的Node.js版本不兼容:
错误:节点加载器:错误:无法找到指定的模块。C:\Users\sudda\AppData\Roaming\npm\node_modules\truffle\node_modules\ganache\dist\node/3jj9vE3p.node回退到NodeJS实现;性能可能降低。
Package.json

{
  "name": "nft-marketplace",
  "version": "0.1.0",
  "description": "An NFT Marketplace",
  "author": "clarionnorth@gmail.com",
  "dependencies": {
    "@metamask/detect-provider": "^1.2.0",
    "@openzeppelin/contracts": "^4.3.1",
    "babel-polyfill": "6.26.0",
    "babel-preset-env": "1.7.0",
    "babel-preset-es2015": "6.24.1",
    "babel-preset-stage-2": "6.24.1",
    "babel-preset-stage-3": "6.24.1",
    "babel-register": "6.26.0",
    "bootstrap": "4.3.1",
    "chai": "4.2.0",
    "chai-as-promised": "7.1.1",
    "chai-bignumber": "3.0.0",
    "mdb-react-ui-kit": "^1.3.0",
    "mdb-ui-kit": "^3.9.0",
    "react": "16.8.4",
    "react-bootstrap": "1.0.0-beta.5",
    "react-dom": "16.8.4",
    "react-scripts": "2.1.3",
    "truffle": "5.0.5",
    "web3": "1.0.0-beta.55"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}

我的节点版本是16.14.0。
如何删除此错误/警告。

guicsvcw

guicsvcw1#

当我运行v19.1.0时发生了这种情况

truffle deploy --network goerli

我换成了

nvm install --lts  # if version '--lts' is not yet installed.
nvm use --lts

Now using node v18.12.1 (npm v8.19.2)

问题已解决

相关问题