Errors using 'npm run build' - node.js

I am using react-boilerplate (https://www.github.com/react-boilerplate) to create a small app. While running the build command (npm run build) for my app, I see the following warning:
WARNING in asset size limit:
The following asset(s) exceed the recommended size limit (250 kB)
This can impact web performance.
Assets:
0.a4edf518ed555866f5cd.chunk.js (286 kB)
And the following errors:
ERROR in 0.a4edf518ed555866f5cd.chunk.js from UglifyJs
Unexpected token name «i», expected punc «;»
[0.a4edf518ed555866f5cd.chunk.js:8982,11]
And:
npm ERR! Linux 3.19.0-80-generic
npm ERR! argv "/home/ahsan/.nvm/versions/node/v6.9.4/bin/node" "/home/ahsan/.nvm/versions/node/v6.9.4/bin/npm" "run" "build"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! react-boilerplate#3.4.0 build: cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the react-boilerplate#3.4.0 build script 'cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress'.
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 react-boilerplate 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 webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs react-boilerplate
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls react-boilerplate
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/ahsan/Desktop/i2x/npm-debug.log`
I can't figure out what this problem might be, need help solving this problem.

Related

Laravel Mix npm run watch fails

I'm trying to compile laravel sass files to apply the changes but every time i run (npm run watch) or (npm run dev) i get these errors...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js "--watch"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # development 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\User\AppData\Roaming\npm-cache_logs\2019-01-01T14_42_14_962Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # watch: npm run development -- --watch
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\User\AppData\Roaming\npm-cache_logs\2019-01-01T14_42_15_042Z-debug.log
The problem is with this error is there are no node_modules.
As the Laravel Mix Documentation states:
You have to run npm install to download all the required packages for Laravel Mix.
If you have node_module folder then delete it and run npm install again.
vue-loader is a loader for webpack that allows you to author Vue components in a format.
Please run the command.
npm i vue-loader

How can I compile assets using Laravel Mix?

I use laravel 5.4
I follow here : https://laravel.com/docs/5.4/mix
If I run this : npm install --no-bin-links, the result like this :
npm WARN deprecated express#2.5.11: express 2.x series is deprecated
npm WARN deprecated connect#1.9.2: connect 1.x series is deprecated
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"install" "--no-bin-links" npm ERR! node v6.9.1 npm ERR! npm v3.10.9
npm ERR! Maximum call stack size exceeded npm ERR! npm ERR! If you
need help, you may report this error at: npm ERR!
https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\xampp\htdocs\myshop\npm-debug.log
There exist error
How can I solve the error?
I use windows 7
I want to fix the error, because I want to compile assets (npm run watch)
Update :
After that I try run npm run dev, the result like this :
# dev C:\xampp\htdocs\myshop
npm run development
# development C:\xampp\htdocs\myshop
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"run" "development" npm ERR! node v6.9.1 npm ERR! npm v3.10.9 npm
ERR! code ELIFECYCLE npm ERR! # development: cross-env
NODE_ENV=development node_modules/webpack/bin/webpack.js --progress
--hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the # development script
'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js
--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=development
node_modules/webpack/bin/webpack.js --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! C:\xampp\htdocs\myshop\npm-debug.log
npm ERR! Windows_NT 6.2.9200 npm ERR! argv "C:\Program
Files\nodejs\node.exe"
"C:\Users\chelsea\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js"
"run" "dev" npm ERR! node v6.9.1 npm ERR! npm v3.10.9 npm ERR! code
ELIFECYCLE npm ERR! # dev: npm run development npm ERR! Exit status
1 npm ERR! npm ERR! Failed at the # dev script 'npm run development'.
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! npm run development 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! C:\xampp\htdocs\myshop\npm-debug.log
I try fix it with answer from #Yevgeniy Afanasyev
This : Laravel 5.4 'cross-env' is not recognized as an internal or external command
But it's the same
Try to execute this command one more time.

cross-env issue when running "npm run dev" for vue-cli

I'm with Centos7, installed on VirtualBox (true OS: Windows 7).
Node version: 6.10.3
Npm version: 3.10.10
I installed vue-cli, like this:
sudo npm install -g vue-cli
Then I created a new vue project, like this:
sudo vue init webpack-simple mynewproject
But I get an error when running "npm run dev":
> mynewproject#1.0.0 dev /var/www/html/mynewproject
> cross-env NODE_ENV=development webpack-dev-server --open --hot
sh: cross-env : commande introuvable
npm ERR! Linux 3.10.0-514.el7.x86_64
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.3
npm ERR! npm v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vuetest#1.0.0 dev: `cross-env NODE_ENV=development webpack-dev-server --open --hot`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the mynewproject#1.0.0 dev script 'cross-env NODE_ENV=development webpack-dev-server --open --hot'.
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 vuetest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development webpack-dev-server --open --hot
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs vuetest
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls vuetest
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/html/mynewproject/npm-debug.log
Does anyone know how to fix it?
You need to cd to your project directory and run:
npm install
You can find the instructions on the webpack-simple github repo

Does not run command npm run build:prod Angular 2 project in production linux server

Execute the command npm run build:prod
I do not know if the error is in the port, or in one of the files.
npm ERR! Linux 2.6.32-642.6.2.el6.x86_64
npm ERR! argv "/root/.nvm/versions/node/v6.9.4/bin/node" "/root/.nvm/versions/node/v6.9.4/bin/npm" "run" "build:prod"
npm ERR! node v6.9.4
npm ERR! npm v4.1.1
npm ERR! code ELIFECYCLE
npm ERR! venfi#3.3.0 build:prod: `webpack --config config/webpack.prod.js --progress --profile --bail`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the venfi#3.3.0 build:prod script 'webpack --config config/webpack.prod.js --progress --profile --bail'.
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 venfi package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! webpack --config config/webpack.prod.js --progress --profile --bail
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs venfi
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls venfi
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /var/www/clients/client6/web5/web/venfi/npm-debug.log
I have tried for many days, what can I do?
Thank you,

Development npm run script not displaying node errors

Using npm run script to start dev: "dev": "NODE_PATH=\"$(pwd)\" nodemon -r babel-register -r babel-polyfill src/index.js",
When an error occurs in node (my code is wrong) the following id displayed:
npm ERR! Linux 4.4.0-45-generic
npm ERR! argv "/home/karlm/.nvm/versions/node/v7.2.0/bin/node" "/home/karlm/.nvm/versions/node/v7.2.0/bin/npm" "run" "start" "--" "--config" "configs/config.json"
npm ERR! node v7.2.0
npm ERR! npm v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! proj#1.1.1 start: `NODE_PATH="$(pwd)" node -r babel-register -r babel-polyfill src/index.js "--config" "configs/config.json"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the proj#1.1.1 start script 'NODE_PATH="$(pwd)" node -r babel-register -r babel-polyfill src/index.js "--config" "configs/config.json"'.
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 avhs-frontdoor package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! NODE_PATH="$(pwd)" node -r babel-register -r babel-polyfill src/index.js "--config" "configs/config.json"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs proj
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls proj
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /home/karl/dev/node/proj/npm-debug.log
npm-debug.log gives nothing. This is quite irritating. Is there anyway for npm to pipe the actual node error out into the console?

Resources