C:\Users\Gumball\Desktop\PROJE\node-server>npm run production
> forfansubsback@4.0.1 production C:\Users\Gumball\Desktop\PROJE\node-server
> node ./server
internal/modules/cjs/loader.js:1226
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error:
\\?\C:\Users\Gumball\Desktop\PROJE\node-server\node_modules\canvas\build\Release\canvas.node
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1226:18)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
at Module.require (internal/modules/cjs/loader.js:1080:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (C:\Users\Gumball\Desktop\PROJE\node-server\node_modules\canvas\lib\bindings.js:3:18)
at Module._compile (internal/modules/cjs/loader.js:1176:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
at Module.load (internal/modules/cjs/loader.js:1040:32)
at Function.Module._load (internal/modules/cjs/loader.js:929:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! forfansubsback@4.0.1 production: `node ./server`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the forfansubsback@4.0.1 production script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Gumball\AppData\Roaming\npm-cache\_logs\2022-09-06T20_55_29_398Z-debug.log
Please help, I've been dealing with this problem all day, I've tried all the ways I can think of, but unfortunately I couldn't find a solution. Can you help me with this
C:\Users\Gumball\AppData\Roaming\npm-cache_logs\2022-09-06T20_55_29_398Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'production'
1 verbose cli ]
2 info using npm@6.14.4
3 info using node@v14.2.0
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle forfansubsback@4.0.1~preproduction: forfansubsback@4.0.1
6 info lifecycle forfansubsback@4.0.1~production: forfansubsback@4.0.1
7 verbose lifecycle forfansubsback@4.0.1~production: unsafe-perm in lifecycle true
8 verbose lifecycle forfansubsback@4.0.1~production: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Gumball\Desktop\PROJE\node-server\node_modules\.bin;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\Gumball\AppData\Local\Microsoft\WindowsApps;C:\Users\Gumball\.dotnet\tools;C:\Users\Gumball\AppData\Roaming\npm
9 verbose lifecycle forfansubsback@4.0.1~production: CWD: C:\Users\Gumball\Desktop\PROJE\node-server
10 silly lifecycle forfansubsback@4.0.1~production: Args: [ '/d /s /c', 'node ./server' ]
11 silly lifecycle forfansubsback@4.0.1~production: Returned: code: 1 signal: null
12 info lifecycle forfansubsback@4.0.1~production: Failed to exec production script
13 verbose stack Error: forfansubsback@4.0.1 production: `node ./server`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:315:20)
13 verbose stack at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:315:20)
13 verbose stack at maybeClose (internal/child_process.js:1051:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid forfansubsback@4.0.1
15 verbose cwd C:\Users\Gumball\Desktop\PROJE\node-server
16 verbose Windows_NT 10.0.19042
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "production"
18 verbose node v14.2.0
19 verbose npm v6.14.4
20 error code ELIFECYCLE
21 error errno 1
22 error forfansubsback@4.0.1 production: `node ./server`
22 error Exit status 1
23 error Failed at the forfansubsback@4.0.1 production script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I looked at the npm log, but I could not find the solution, I would be very happy if you could help.
NOTE: I deleted node_server and reinstalled npm but I couldn't find the solution
I followed these steps but couldn't find the solution
Step 1: $ npm cache clean --force
Step 2: Delete node_modules by $ rm -rf node_modules
( rmdir /S /Q node_modules
in windows) folder or delete it manually by going into the directory and right-click > delete / move to trash. If you are not updating your packages you can delete the package-lock.json file too.
Step 3: npm install
To start again, $ npm start
This worked for me. Hopes it works for you too.
PS: Still if it is there, kindly check the error it is displaying in red and act accordingly. This error is specific to node.js environment.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.