我在cpanel中启动node js应用程序时遇到此错误。
RangeError: WebAssembly.instantiate(): Out of memory: wasm memory
at internal/deps/cjs-module-lexer/dist/lexer.js:1:33573
但是当我在localhost中开发时,一切都运行得很好。
这是我的输出日志
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/opt/alt/alt-nodejs14/root/usr/bin/node',
1 verbose cli '/opt/alt/alt-nodejs14/root/usr/bin/npm',
1 verbose cli 'run-script',
1 verbose cli 'start',
1 verbose cli '--'
1 verbose cli ]
2 info using npm@6.14.13
3 info using node@v14.17.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle thewebapp@1.0.0~prestart: thewebapp@1.0.0
6 info lifecycle thewebapp@1.0.0~start: thewebapp@1.0.0
7 verbose lifecycle thewebapp@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle thewebapp@1.0.0~start: PATH: /opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/node-gyp-bin:/home/proudpos/backend/node_modules/.bin:/opt/alt/alt-nodejs14/root/usr/bin:/home/proudpos/nodevenv/backend/14/bin:/opt/alt/alt-nodejs14/root/usr/bin:/home/proudpos/nodevenv/backend/14/lib/bin/:/usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin:/opt/bin
9 verbose lifecycle thewebapp@1.0.0~start: CWD: /home/proudpos/backend
10 silly lifecycle thewebapp@1.0.0~start: Args: [ '-c', 'node server.js' ]
11 silly lifecycle thewebapp@1.0.0~start: Returned: code: 1 signal: null
12 info lifecycle thewebapp@1.0.0~start: Failed to exec start script
13 verbose stack Error: thewebapp@1.0.0 start: `node server.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:375:28)
13 verbose stack at ChildProcess.<anonymous> (/opt/alt/alt-nodejs14/root/usr/lib/node_modules/npm/node_modules.bundled/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:375:28)
13 verbose stack at maybeClose (internal/child_process.js:1055:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid thewebapp@1.0.0
15 verbose cwd /home/proudpos/backend
16 verbose Linux 3.10.0-962.3.2.lve1.5.60.el7.x86_64
17 verbose argv "/opt/alt/alt-nodejs14/root/usr/bin/node" "/opt/alt/alt-nodejs14/root/usr/bin/npm" "run-script" "start" "--"
18 verbose node v14.17.3
19 verbose npm v6.14.13
20 error code ELIFECYCLE
21 error errno 1
22 error thewebapp@1.0.0 start: `node server.js`
22 error Exit status 1
23 error Failed at the thewebapp@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
我搜索,但找不到任何答案。需要一些帮助。
5条答案
按热度按时间lsmepo6l1#
我遇到了同样的问题,我正在后台运行vps的node命令,突然它就坏了,我去我的cpanel终端,停止了作业,试图重新启动,但它给了我那个错误,我无法修复它。我打开我的本地机器的终端,通过ssh访问应用程序,并重新上传了代码,然后它工作正常。我仍然不明白cpanel终端和我的笔记本电脑终端的区别。
fxnxkyjh2#
只需ssh和运行npm,运行dev,它就会工作。在我的情况下,我没有重新上传代码。
e3bfsja23#
我遇到了同样的错误,令人惊讶的是,我运行了同样的命令npm run dev,但从SSH而不是cPanel,它工作得很好!
jobtbby34#
嗯,原来我在package.json文件中使用的是
type: "module"
。这个问题一直阻碍着cpanel运行我的应用程序。2我在ssh上运行的很好,但是通过cpanel就不正常了。3我的
node -v
返回了v14.18.1import
更改为require
。type: "module"
u3r8eeie5#
在我的情况下,我已经重新启动我的电脑,它不会再次恢复.