npm run production doesn't run successfully. I have tried to remove the node_modules folder and run npm install but nothing still.
I have also tried to uninstall and install npm from the system but I still am having the same issue.
But watch is running fine but not production.
production script does:
"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",
I am using npm version 6.7.0 and nodejs version 8.11.4
The script consoles the following error in the npm error log:
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/local/bin/npm', 'run', 'prod' ]
2 info using npm#6.7.0
3 info using node#v8.11.4
4 verbose run-script [ 'preprod', 'prod', 'postprod' ]
5 info lifecycle #~preprod: #
6 info lifecycle #~prod: #
7 verbose lifecycle #~prod: unsafe-perm in lifecycle true
8 verbose lifecycle #~prod: PATH: /usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/var/www/html/****/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
9 verbose lifecycle #~prod: CWD: /var/www/html/****
10 silly lifecycle #~prod: Args: [ '-c', 'npm run production' ]
11 silly lifecycle #~prod: Returned: code: 1 signal: null
12 info lifecycle #~prod: Failed to exec prod script
13 verbose stack Error: # prod: npm run production
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid #
15 verbose cwd /var/www/html/****
16 verbose Linux 4.18.0-11-generic
17 verbose argv "/usr/bin/node" "/usr/local/bin/npm" "run" "prod"
18 verbose node v8.11.4
19 verbose npm v6.7.0
20 error code ELIFECYCLE
21 error errno 1
22 error # prod: npm run production
22 error Exit status 1
23 error Failed at the # prod script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I had same issue because I used to put MIX_SENTRY_DSN_PUBLIC in webpack like this (NOT WORKING):
mix.js('resources/js/app.js', process.env.MIX_SENTRY_DSN_PUBLIC/'public/js')
.sass('resources/sass/app.scss', process.env.MIX_SENTRY_DSN_PUBLIC/'public/css');
instead of:
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css');
Related
I'm currently using Cypress, and I would like to run some commands. However, I'm pretty new to Windows, and I'm having issues setting up the script to do the right thing.
"scripts": {
"clean:reports": "rm -r -fo cypress\\reports && mkdir cypress\\reports && mkdir cypress\\reports\\mochareports",
"pretest": "npm run clean:reports",
"scripts": "cypress run",
"combine-reports": "mochawesome-merge --reportDir cypress\\reports\\mocha > Cypress\\reports\\mochareports\\reports.json",
"generate-reports": "merge Cypress\\reports\\mochareports\\report.json -f report -o Cypress\\reports\\mochareports",
"posttest": "npm run combine-reports && npm run generate-report",
"test": "npm run scripts || npm run posttest"
}
Error message:
Cypress_Mocha#1.0.0 pretest C:\Users\aharo\Desktop\Automation\Cypress_Mocha
> npm run clean:reports
> Cypress_Mocha#1.0.0 clean:reports C:\Users\aharo\Desktop\Automation\Cypress_Mocha
> rmdir .\cypress\reports && mkdir cypress\reports && mkdir cypress\reports\mochareports
The system cannot find the file specified.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Cypress_Mocha#1.0.0 clean:reports: `rmdir .\cypress\reports && mkdir cypress\reports && mkdir cypress\reports\mochareports`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Cypress_Mocha#1.0.0 clean:reports 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\aharo\AppData\Roaming\npm-cache\_logs\2020-12-31T16_54_14_427Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Cypress_Mocha#1.0.0 pretest: `npm run clean:reports`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Cypress_Mocha#1.0.0 pretest 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\aharo\AppData\Roaming\npm-cache\_logs\2020-12-31T16_54_14_464Z-debug.log
Is it possible if someone can help me a little bit more to understand what I have to do differently?
If I take a look at the logs through CMD, this is what I have:
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:\\Users\\aharo\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'test' 1 verbose cli ] 2 info using npm#6.14.10 3 info using node#v15.5.0 4 verbose run-script [ 'pretest', 'test', 'posttest' ] 5 info lifecycle Cypress_Mocha#1.0.0~pretest: Cypress_Mocha#1.0.0 6 verbose lifecycle Cypress_Mocha#1.0.0~pretest: unsafe-perm in lifecycle true 7 verbose lifecycle Cypress_Mocha#1.0.0~pretest: PATH: C:\Users\aharo\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\aharo\Desktop\Automation\Cypress_Mocha\node_modules\.bin;C:\Python39\Scripts\;C:\Python39\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files\Git\cmd;C:\Users\aharo\AppData\Local\Microsoft\WindowsApps;C:\Users\aharo\AppData\Roaming\npm;C:\Users\aharo\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\aharo\AppData\Local\Yarn\bin 8 verbose lifecycle Cypress_Mocha#1.0.0~pretest: CWD: C:\Users\aharo\Desktop\Automation\Cypress_Mocha 9 silly lifecycle Cypress_Mocha#1.0.0~pretest: Args: [ '/d /s /c', 'npm run clean:reports' ] 10 silly lifecycle Cypress_Mocha#1.0.0~pretest: Returned: code: 2 signal: null 11 info lifecycle Cypress_Mocha#1.0.0~pretest: Failed to exec pretest script 12 verbose stack Error: Cypress_Mocha#1.0.0 pretest: `npm run clean:reports` 12 verbose stack Exit status 2 12 verbose stack at EventEmitter.<anonymous> (C:\Users\aharo\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 12 verbose stack at EventEmitter.emit (node:events:376:20) 12 verbose stack at ChildProcess.<anonymous> (C:\Users\aharo\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 12 verbose stack at ChildProcess.emit (node:events:376:20) 12 verbose stack at maybeClose (node:internal/child_process:1063:16) 12 verbose stack at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5) 13 verbose pkgid Cypress_Mocha#1.0.0 14 verbose cwd C:\Users\aharo\Desktop\Automation\Cypress_Mocha 15 verbose Windows_NT 10.0.18363 16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\aharo\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "test" 17 verbose node v15.5.0 18 verbose npm v6.14.10 19 error code ELIFECYCLE 20 error errno 2 21 error Cypress_Mocha#1.0.0 pretest: `npm run clean:reports` 21 error Exit status 2 22 error Failed at the Cypress_Mocha#1.0.0 pretest script. 22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 2, true ]
I'm attending a bootcamp running Mac and using windows at home. I downloaded a webpack project from github to run on my windows 7 system and it won't build. I found this error in a search and it advised running
npm install webpack-dev-server#2.9.7 --save-dev
, but the error persists. I tried starting over on my Win10 laptop and i get the same error.
I did find guidance that on package.json, I should change this line:
"start": "npm run build & webpack-dev-server --open --mode development",
The change was previously using a semi-colon instead of "&". Still no joy.
I need some help.
here is the error 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 'build'
1 verbose cli ]
2 info using npm#6.12.0
3 info using node#v12.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-project#1.0.0~prebuild: my-project#1.0.0
6 info lifecycle my-project#1.0.0~build: my-project#1.0.0
7 verbose lifecycle my-project#1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-project#1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\MP3 Machine\code\doctor-week6-codereview\node_modules\.bin;C:\Users\MP3 Machine\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\MP3 Machine\bin;C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\MICROSOFT SQL SERVER\80\TOOLS\BINN;C:\PROGRAM FILES (X86)\OPENVPN\BIN;C:\PROGRAM FILES (X86)\WINDOWS LIVE\SHARED;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\MP3 Machine\AppData\Local\learn_ide_3\bin;C:\Users\MP3 Machine\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle my-project#1.0.0~build: CWD: C:\Users\MP3 Machine\code\doctor-week6-codereview
10 silly lifecycle my-project#1.0.0~build: Args: [ '/d /s /c', 'webpack --mode development' ]
11 silly lifecycle my-project#1.0.0~build: Returned: code: 2 signal: null
12 info lifecycle my-project#1.0.0~build: Failed to exec build script
13 verbose stack Error: my-project#1.0.0 build: `webpack --mode development`
13 verbose stack Exit status 2
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:210:5)
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:210:5)
13 verbose stack at maybeClose (internal/child_process.js:1021:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid my-project#1.0.0
15 verbose cwd C:\Users\MP3 Machine\code\doctor-week6-codereview
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
18 verbose node v12.13.0
19 verbose npm v6.12.0
20 error code ELIFECYCLE
21 error errno 2
22 error my-project#1.0.0 build: `webpack --mode development`
22 error Exit status 2
23 error Failed at the my-project#1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]
Just had the same problem. Make sure your main (index) HTML file,is "in" the src file
I want ton install Bulma via NPM im using NPM install bulma but what should i do after that?
I added bulma snippet in app.scss
// Bulma
#import "node_modules/bulma/bulma";
And when I use NPM run dev I get this error with this log:
0 info it worked if it ends with ok
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 'dev' ]
2 info using npm#5.4.2
3 info using node#v8.7.0
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle #~predev: #
6 info lifecycle #~dev: #
7 verbose lifecycle #~dev: unsafe-perm in lifecycle true
8 verbose lifecycle #~dev: PATH: C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin;D:\laragon\www\vue\node_modules\.bin;C:\Users\Mehdi\AppData\Local\Yarn\config\global\node_modules\.bin;C:\Users\Mehdi\AppData\Roaming\npm;C:\Users\Mehdi\AppData\Roaming\Composer\vendor\bin;;D:\laragon\bin\laragon\utils;D:\laragon\bin\mysql\mariadb-10.3.10-winx64\bin;D:\laragon\bin\php\php-7.2.11-Win32-VC15-x64;D:\laragon\bin\composer;D:\laragon\bin\apache\httpd-2.4.35-win64-VC15\bin;D:\laragon\bin\redis\redis-x64-3.2.100;D:\laragon\bin\nginx\nginx-1.14.0;D:\laragon\bin\notepad++;D:\laragon\bin\telnet;D:\laragon\bin\ngrok;D:\laragon\bin;D:\laragon\usr\bin;D:\laragon\bin\putty;D:\laragon\bin\cmder\bin;D:\laragon\bin\cmder\vendor\conemu-maximus5\ConEmu\Scripts;D:\laragon\bin\cmder\vendor\conemu-maximus5;D:\laragon\bin\cmder\vendor\conemu-maximus5\ConEmu;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64;C:\Program Files\nodejs\;C:\Program Files (x86)\Yarn\bin\;C:\Program Files (x86)\Java\jdk1.8.0_112\bin;C:\Users\Mehdi\AppData\Roaming\npm;C:\Users\Mehdi\AppData\Local\Yarn\bin;C:\Users\Mehdi\AppData\Local\atom\bin;C:\Program Files (x86)\Java\jdk1.8.0_112\bin;;D:\laragon\bin\cmder\;
9 verbose lifecycle #~dev: CWD: D:\laragon\www\vue
10 silly lifecycle #~dev: Args: [ '/d /s /c', 'npm run development' ]
11 silly lifecycle #~dev: Returned: code: 1 signal: null
12 info lifecycle #~dev: Failed to exec dev script
13 verbose stack Error: # dev: `npm run development`
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:280:16)
13 verbose stack at emitTwo (events.js:125:13)
13 verbose stack at EventEmitter.emit (events.js:213:7)
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 emitTwo (events.js:125:13)
13 verbose stack at ChildProcess.emit (events.js:213:7)
13 verbose stack at maybeClose (internal/child_process.js:927:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid #
15 verbose cwd D:\laragon\www\vue
16 verbose Windows_NT 6.1.7601
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
18 verbose node v8.7.0
19 verbose npm v5.4.2
20 error code ELIFECYCLE
21 error errno 1
22 error # dev: `npm run development`
22 error Exit status 1
23 error Failed at the # dev script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
You can import bulma in SCSS using
#import "bulma/bulma.sass";
I' m trying to deploy my Laravel App on shared hosting. I'm also using Vuejs. Almost everything works fine. Only problem is component which is not updating after change. I'm doing following steps:
Copy Laravel project (files) from localhost to shared hosting. Project is working (except vue)
Installation of nodejs in root directory (not in laravel folder). I use following commands:
2.1 wget -qO- https://cdn.rawgit.com/creationix/nvm/master/install.sh | bash
2.2 export NVM_DIR="$HOME/.nvm"
2.3 [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
2.4 [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
2.5 nvm install node
2.6 nvm use node
Next I'm going to laravel folder and input npm run watch but I get an error. Below is the content of log of npm
0 info it worked if it ends with ok
1 verbose cli [ '/home/mojstrona/.nvm/versions/node/v10.10.0/bin/node',
1 verbose cli '/home/mojstrona/.nvm/versions/node/v10.10.0/bin/npm',
1 verbose cli 'run',
1 verbose cli 'watch' ]
2 info using npm#6.4.1
3 info using node#v10.10.0
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle #~prewatch: #
6 info lifecycle #~watch: #
7 verbose lifecycle #~watch: unsafe-perm in lifecycle true
8 verbose lifecycle #~watch: PATH: /home/mojstrona/.nvm/versions/node/v10.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/mojstrona/domains/moj.stronazen.pl/l55/node_modules/.bin:/home/mojstrona/.nvm/versions/node/v10.10.0/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/opt/puppetlabs/bin:/home/mojstrona/.local/bin:/home/mojstrona/bin
9 verbose lifecycle #~watch: CWD: /home/mojstrona/domains/moj.stronazen.pl/l55
10 silly lifecycle #~watch: Args: [ '-c',
10 silly lifecycle 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle #~watch: Returned: code: 126 signal: null
12 info lifecycle #~watch: Failed to exec watch script
13 verbose stack Error: # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 126
13 verbose stack at EventEmitter.<anonymous> (/home/mojstrona/.nvm/versions/node/v10.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack at EventEmitter.emit (events.js:182:13)
13 verbose stack at ChildProcess.<anonymous> (/home/mojstrona/.nvm/versions/node/v10.10.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:182:13)
13 verbose stack at maybeClose (internal/child_process.js:962:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
14 verbose pkgid #
15 verbose cwd /home/mojstrona/domains/moj.stronazen.pl/l55
16 verbose Linux 3.10.0-714.10.2.lve1.5.17.el7.x86_64
17 verbose argv "/home/mojstrona/.nvm/versions/node/v10.10.0/bin/node" "/home/mojstrona/.nvm/versions/node/v10.10.0/bin/npm" "run" "watch"
18 verbose node v10.10.0
19 verbose npm v6.4.1
20 error code ELIFECYCLE
21 error errno 126
22 error # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 126
23 error Failed at the # watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 126, true ]
I can solve this error using chmod -R a+x node_modules, bute I get next error
error in ./resources/assets/sass/app.scss
Module build failed: Error: Missing binding /home/mojstrona/domains/moj.stronazen.pl/l55/node_modules/node-sass/vendor/linux-x64-64/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 10.x** Run `npm rebuild node-sass` to download the binding for your current environment.
So I'm restarting SSH and running npm rebuild node-sass without errors. Then I'm running npm run watch with any errors too, but the problem still exists. Components are not updated after changes even if I change component name. for example:
Before change in app.js
Vue.component('ex', require('./components/ExampleComponent.vue'));
Before change in components folder
ExampleComponent.vue
Displayed
ExampleComponent.vue
After change in app.js
Vue.component('ex', require('./components/ExampleComponent2.vue'));
After change in components folder
ExampleComponent2.vue
Displayed after change
ExampleComponent.vue
After change2 in app.js
Vue.component('ex', require('./components/ExampleComponent2.vue'));
After change2 in components folder
ExampleComponent3.vue
Displayed after change2
ExampleComponent.vue
Below is the screenshot of result of npm run commands.
Bundle compiles successfully couple of times but then i get this error:
Error:
95% emittingError: UNKNOWN: unknown error, open 'D:\Web Development\Projects\GUIRebuild\public\js\super_admin_bundle.js
'
at Error (native)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules
--config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # watch 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\Smolen\AppData\Roaming\npm-cache\_logs\2017-12-01T05_07_28_612Z-debug.log
Log:
0 info it worked if it ends with ok
1 verbose cli [ 'D:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Smolen\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'watch' ]
2 info using npm#5.5.1
3 info using node#v6.11.3
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle #~prewatch: #
6 info lifecycle #~watch: #
7 verbose lifecycle #~watch: unsafe-perm in lifecycle true
8 verbose lifecycle #~watch: PATH: C:\Users\Smolen\AppData\Roaming\npm\node_modules\npm\bin\node-gyp-bin;D:\Web Development\Projects\GUIRebuild\node_modules\.bin;%SystemRoot%\system32\WindowsPowerShell\v1.0\;C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;D:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;D:\HashiCorp\Vagrant\bin;D:\Program Files\Git\cmd;D:\Program Files\nodejs\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\ProgramData\chocolatey\bin;C:\Program Files\Lenovo\Bluetooth Software\;C:\Program Files\Lenovo\Bluetooth Software\syswow64;D:\Program Files (x86)\PuTTY\;C:\Users\Smolen\AppData\Local\atom\bin;C:\Users\Smolen\AppData\Roaming\npm;D:\Users\Smolen\AppData\Local\Android\sdk\platform-tools;
9 verbose lifecycle #~watch: CWD: D:\Web Development\Projects\GUIRebuild
10 silly lifecycle #~watch: Args: [ '/d /s /c',
10 silly lifecycle 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js' ]
11 silly lifecycle #~watch: Returned: code: 1 signal: null
12 info lifecycle #~watch: Failed to exec watch script
13 verbose stack Error: # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
13 verbose stack Exit status 1
13 verbose stack at EventEmitter.<anonymous> (C:\Users\Smolen\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:280:16)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at EventEmitter.emit (events.js:191:7)
13 verbose stack at ChildProcess.<anonymous> (C:\Users\Smolen\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack at emitTwo (events.js:106:13)
13 verbose stack at ChildProcess.emit (events.js:191:7)
13 verbose stack at maybeClose (internal/child_process.js:920:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)
14 verbose pkgid #
15 verbose cwd D:\Web Development\Projects\GUIRebuild
16 verbose Windows_NT 6.1.7601
17 verbose argv "D:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Smolen\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "watch"
18 verbose node v6.11.3
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 1
22 error # watch: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
22 error Exit status 1
23 error Failed at the # watch script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]
I have no idea why is this happening, i am using vagrant and virtual box but this compiles on my machine not on the virtual one.I get this "Unknown error" on random files.
What i have tried:
Remove/Reinstall node_modules
Upgrade Node and NPM
Clear NPM cache
OS: Windows 7
Laravel: 5.4v
NPM: 5.5.1v
You can try removing node_modules folder and run again
npm install
In my case the output directory was corrupted and could not be opened anymore, so webpack could not access it.
Working around that by checking out the project in another location was the fastest solution, as deleting the directory was not easy and required repairing the drive with the windows repair tool (Right-Click in File Manager on Drive -> Properties -> Tools -> Disk Check).