我正在使用Next.js进行项目并做出反应。在我的项目中,Next.js版本是4.2.3,并且我的应用程序使用“ npm run dev”正常运行,但使用“ npm run build”却正常运行,因为某些模块不支持ES6。解决问题失败后,我决定再次重新安装所需的模块。
next.js的版本现在是8.1.0。但是,在重新安装模块之后,我无法运行(npm运行dev或节点server.js)或构建(npm run build)该应用程序,因为我收到此错误,但找不到解决方法:
Build error occurred
Error: /home/parastoo/Dropbox/Projects/Ethereum/node_modules/scrypt/build/Release/scrypt.node: invalid ELF header
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/parastoo/Dropbox/Projects/Ethereum/node_modules/scrypt/index.js:3:20)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/home/parastoo/Dropbox/Projects/Ethereum/node_modules/scrypt.js/node.js:1:76)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
package.json就像:
{
"name": "supplychain",
"version": "1.0.0",
"description": "",
"main": "routes.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "node server.js",
"start": "node server.js",
"build": "next build"
},
"author": "",
"license": "ISC",
"dependencies": {
"fs-extra": "^8.0.1",
"ganache-cli": "^6.4.4",
"mocha": "^6.1.4",
"next": "^8.1.0",
"next-routes": "^1.4.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"scrypt": "^6.0.3",
"semantic-ui-react": "^0.87.2",
"solc": "^0.5.9",
"web3": "^1.0.0-beta.35"
}
}
操作系统是Ubuntu 18.04 LTS。
有什么办法可以解决这个问题?