[GH-ISSUE #69] NPM error when trying to install Web Application #107

Closed
opened 2026-03-01 17:44:51 +03:00 by kerem · 5 comments
Owner

Originally created by @daggr8 on GitHub (Aug 25, 2020).
Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/69

So when i run "npm run production" i get an error i cant figure out. Anything i missed?

> @ production /var/www/anonaddy
> cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/webpack/bin/webpack.js ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm ERR! Linux 4.15.0-112-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "production"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/anonaddy/npm-debug.log

npm-debug.log contains


`0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'production' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 silly lifecycle @~preproduction: no script for preproduction, continuing
7 info lifecycle @~production: @
8 verbose lifecycle @~production: unsafe-perm in lifecycle true
9 verbose lifecycle @~production: PATH: /usr/share/npm/bin/node-gyp-bin:/var/www/anonaddy/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~production: CWD: /var/www/anonaddy
11 silly lifecycle @~production: Args: [ '-c',
11 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
12 silly lifecycle @~production: Returned: code: 1  signal: null
13 info lifecycle @~production: Failed to exec production script
14 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:925:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid @
16 verbose cwd /var/www/anonaddy
17 error Linux 4.15.0-112-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "production"
19 error node v8.10.0
20 error npm  v3.5.2
21 error code ELIFECYCLE
22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
`
Originally created by @daggr8 on GitHub (Aug 25, 2020). Original GitHub issue: https://github.com/anonaddy/anonaddy/issues/69 So when i run "npm run production" i get an error i cant figure out. Anything i missed? ``` > @ production /var/www/anonaddy > cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js events.js:183 throw er; // Unhandled 'error' event ^ Error: spawn node_modules/webpack/bin/webpack.js ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 npm ERR! Linux 4.15.0-112-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "production" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code ELIFECYCLE npm ERR! @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /var/www/anonaddy/npm-debug.log ``` npm-debug.log contains ``` `0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'production' ] 2 info using npm@3.5.2 3 info using node@v8.10.0 4 verbose run-script [ 'preproduction', 'production', 'postproduction' ] 5 info lifecycle @~preproduction: @ 6 silly lifecycle @~preproduction: no script for preproduction, continuing 7 info lifecycle @~production: @ 8 verbose lifecycle @~production: unsafe-perm in lifecycle true 9 verbose lifecycle @~production: PATH: /usr/share/npm/bin/node-gyp-bin:/var/www/anonaddy/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 10 verbose lifecycle @~production: CWD: /var/www/anonaddy 11 silly lifecycle @~production: Args: [ '-c', 11 silly lifecycle 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ] 12 silly lifecycle @~production: Returned: code: 1 signal: null 13 info lifecycle @~production: Failed to exec production script 14 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 14 verbose stack Exit status 1 14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16) 14 verbose stack at emitTwo (events.js:126:13) 14 verbose stack at EventEmitter.emit (events.js:214:7) 14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14) 14 verbose stack at emitTwo (events.js:126:13) 14 verbose stack at ChildProcess.emit (events.js:214:7) 14 verbose stack at maybeClose (internal/child_process.js:925:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 15 verbose pkgid @ 16 verbose cwd /var/www/anonaddy 17 error Linux 4.15.0-112-generic 18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "production" 19 error node v8.10.0 20 error npm v3.5.2 21 error code ELIFECYCLE 22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 22 error Exit status 1 23 error Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js 23 error You can get information on how to open an issue for this project with: 23 error npm bugs 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ] ` ```
kerem closed this issue 2026-03-01 17:44:51 +03:00
Author
Owner

@daggr8 commented on GitHub (Aug 26, 2020):

Reinstalled on a new machine and got a new error while running "composer install && npm install"

`npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm ERR! Linux 4.15.0-112-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /var/www/anonaddy/npm-debug.log
`

npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'production' ]
2 info using npm@3.5.2
3 info using node@v8.10.0
4 verbose run-script [ 'preproduction', 'production', 'postproduction' ]
5 info lifecycle @~preproduction: @
6 silly lifecycle @~preproduction: no script for preproduction, continuing
7 info lifecycle @~production: @
8 verbose lifecycle @~production: unsafe-perm in lifecycle true
9 verbose lifecycle @~production: PATH: /usr/share/npm/bin/node-gyp-bin:/var/www/anonaddy/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
10 verbose lifecycle @~production: CWD: /var/www/anonaddy
11 silly lifecycle @~production: Args: [ '-c',
11 silly lifecycle   'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
12 silly lifecycle @~production: Returned: code: 1  signal: null
13 info lifecycle @~production: Failed to exec production script
14 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at EventEmitter.emit (events.js:214:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:126:13)
14 verbose stack     at ChildProcess.emit (events.js:214:7)
14 verbose stack     at maybeClose (internal/child_process.js:925:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
15 verbose pkgid @
16 verbose cwd /var/www/anonaddy
17 error Linux 4.15.0-112-generic
18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "production"
19 error node v8.10.0
20 error npm  v3.5.2
21 error code ELIFECYCLE
22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

<!-- gh-comment-id:680836889 --> @daggr8 commented on GitHub (Aug 26, 2020): Reinstalled on a new machine and got a new error while running "composer install && npm install" ``` `npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies. npm ERR! Linux 4.15.0-112-generic npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" npm ERR! node v8.10.0 npm ERR! npm v3.5.2 npm ERR! code EMISSINGARG npm ERR! typeerror Error: Missing required argument #1 npm ERR! typeerror at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3) npm ERR! typeerror at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22) npm ERR! typeerror at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12) npm ERR! typeerror at /usr/share/npm/lib/install/deps.js:457:7 npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror at /usr/share/npm/lib/fetch-package-metadata.js:37:12 npm ERR! typeerror at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5) npm ERR! typeerror at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7) npm ERR! typeerror at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20) npm ERR! typeerror at /usr/share/npm/node_modules/iferr/index.js:13:50 npm ERR! typeerror This is an error with npm itself. Please report this error at: npm ERR! typeerror <http://github.com/npm/npm/issues> npm ERR! Please include the following file with any support request: npm ERR! /var/www/anonaddy/npm-debug.log ` ``` npm-debug.log ``` 0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'production' ] 2 info using npm@3.5.2 3 info using node@v8.10.0 4 verbose run-script [ 'preproduction', 'production', 'postproduction' ] 5 info lifecycle @~preproduction: @ 6 silly lifecycle @~preproduction: no script for preproduction, continuing 7 info lifecycle @~production: @ 8 verbose lifecycle @~production: unsafe-perm in lifecycle true 9 verbose lifecycle @~production: PATH: /usr/share/npm/bin/node-gyp-bin:/var/www/anonaddy/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin 10 verbose lifecycle @~production: CWD: /var/www/anonaddy 11 silly lifecycle @~production: Args: [ '-c', 11 silly lifecycle 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ] 12 silly lifecycle @~production: Returned: code: 1 signal: null 13 info lifecycle @~production: Failed to exec production script 14 verbose stack Error: @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 14 verbose stack Exit status 1 14 verbose stack at EventEmitter.<anonymous> (/usr/share/npm/lib/utils/lifecycle.js:232:16) 14 verbose stack at emitTwo (events.js:126:13) 14 verbose stack at EventEmitter.emit (events.js:214:7) 14 verbose stack at ChildProcess.<anonymous> (/usr/share/npm/lib/utils/spawn.js:24:14) 14 verbose stack at emitTwo (events.js:126:13) 14 verbose stack at ChildProcess.emit (events.js:214:7) 14 verbose stack at maybeClose (internal/child_process.js:925:16) 14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) 15 verbose pkgid @ 16 verbose cwd /var/www/anonaddy 17 error Linux 4.15.0-112-generic 18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "production" 19 error node v8.10.0 20 error npm v3.5.2 21 error code ELIFECYCLE 22 error @ production: `cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` 22 error Exit status 1 23 error Failed at the @ production script 'cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'. 23 error Make sure you have the latest version of node.js and npm installed. 23 error If you do, this is most likely a problem with the package, 23 error not with npm itself. 23 error Tell the author that this fails on your system: 23 error cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js 23 error You can get information on how to open an issue for this project with: 23 error npm bugs 23 error Or if that isn't available, you can get their info via: 23 error npm owner ls 23 error There is likely additional logging output above. 24 verbose exit [ 1, true ] ```
Author
Owner

@daggr8 commented on GitHub (Aug 26, 2020):

Resolved by running "nvm install 12.18.3".

<!-- gh-comment-id:680972165 --> @daggr8 commented on GitHub (Aug 26, 2020): Resolved by running "nvm install 12.18.3".
Author
Owner

@willbrowningme commented on GitHub (Aug 26, 2020):

Have you tried updating to a newer version of node e.g. v12.18.3? Deleting node_modules folder and package-lock.json and trying again?

<!-- gh-comment-id:680972682 --> @willbrowningme commented on GitHub (Aug 26, 2020): Have you tried updating to a newer version of node e.g. v12.18.3? Deleting node_modules folder and package-lock.json and trying again?
Author
Owner

@daggr8 commented on GitHub (Aug 26, 2020):

Haha. You answered at the same time i found it out :). Thanks!

<!-- gh-comment-id:680973063 --> @daggr8 commented on GitHub (Aug 26, 2020): Haha. You answered at the same time i found it out :). Thanks!
Author
Owner

@willbrowningme commented on GitHub (Aug 26, 2020):

Great, just commented at the same time!

<!-- gh-comment-id:680973181 --> @willbrowningme commented on GitHub (Aug 26, 2020): Great, just commented at the same time!
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/anonaddy#107
No description provided.