laravel-5-angular-2-example icon indicating copy to clipboard operation
laravel-5-angular-2-example copied to clipboard

I get error if I write "npm run prod" or "npm run dev" command?

Open jedelhu opened this issue 8 years ago • 9 comments

2016-10-19_1807 2016-10-19_1806

jedelhu avatar Oct 19 '16 13:10 jedelhu

If I use to run Angular 2 project alone it does not give any error

jedelhu avatar Oct 19 '16 13:10 jedelhu

$(npm bin) won't work on Windows.

sanex3339 avatar Oct 19 '16 13:10 sanex3339

right now you can use following command

NODE_ENV=production node_modules/.bin/webpack

Later i will update scripts and replace $(npm bin) with node_modules/.bin

sanex3339 avatar Oct 19 '16 13:10 sanex3339

NODE_ENV=production node_modules/.bin/webpack doesn't work

try SET NODE_ENV=production node_modules/.bin/webpack

arturqocharyan avatar Oct 21 '16 08:10 arturqocharyan

http://screencast.com/t/rXHXig0QZFhO

arturqocharyan avatar Oct 21 '16 08:10 arturqocharyan

you forgot --watch.

"scripts": { "prod": "npm run webpack", "dev": "npm run webpack:watch", "build": "npm run webpack", "webpack": "NODE_ENV=production node_modules/.bin/webpack", "webpack:watch": "node_modules/.bin/webpack --watch" },

hugoburguete avatar Oct 23 '16 15:10 hugoburguete

ERROR in chunk vendor [entry] js/styles.8a70374d33baa4a9394d.js Template cannot be applied as TemplateArgument: HarmonyImportDependency

It was appeared for me. Please help me. Thanks.

pacificsoftdevld avatar Nov 02 '16 08:11 pacificsoftdevld

i got same issue on ubuntu. Could you fix this or suggest solution for resolve this?

root@e2c25918114c:/var/www/itracker# npm run prod

@ prod /var/www/itracker npm run webpack

@ webpack /var/www/itracker NODE_ENV=production $(npm bin)/webpack

clean-webpack-plugin: /var/www/itracker/public/js has been removed. clean-webpack-plugin: /var/www/itracker/public/styles has been removed. clean-webpack-plugin: /var/www/itracker/public/images/hashed has been removed. clean-webpack-plugin: /var/www/itracker/public/fonts/hashed has been removed.

Starting to optimize CSS... Hash: fcf77c02875cca4682c8 Version: webpack 2.1.0-beta.27 Time: 26994ms Asset Size Chunks Chunk Names js/main.41648f0d21ee0291440f.js 92.3 kB 0 [emitted] main js/vendor.495a3835f6a392804f4a.js 1.04 MB 1 [emitted] vendor js/main.41648f0d21ee0291440f.js.map 618 kB 0 [emitted] main js/vendor.495a3835f6a392804f4a.js.map 7.63 MB 1 [emitted] vendor rev-manifest.json 218 bytes [emitted]
[269] . async 160 bytes {1} [built] + 963 hidden modules

WARNING in DedupePlugin: This plugin was removed from webpack. remove it from configuration.

ERROR in Entry module not found: Error: Can't resolve 'css' in '/var/www/itracker' BREAKING CHANGE: It's no longer allowed to omit the '-loader' prefix when using loaders. You need to specify 'css-loader' instead of 'css'.

npm ERR! Linux 4.4.0-47-generic npm ERR! argv "/home/laradock/.nvm/versions/node/v7.1.0/bin/node" "/home/laradock/.nvm/versions/node/v7.1.0/bin/npm" "run" "webpack" npm ERR! node v7.1.0 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE npm ERR! @ webpack: NODE_ENV=production $(npm bin)/webpack npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the @ webpack script 'NODE_ENV=production $(npm bin)/webpack'. 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! NODE_ENV=production $(npm bin)/webpack 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/itracker/npm-debug.log

npm ERR! Linux 4.4.0-47-generic npm ERR! argv "/home/laradock/.nvm/versions/node/v7.1.0/bin/node" "/home/laradock/.nvm/versions/node/v7.1.0/bin/npm" "run" "prod" npm ERR! node v7.1.0 npm ERR! npm v3.10.9 npm ERR! code ELIFECYCLE npm ERR! @ prod: npm run webpack npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ prod script 'npm run webpack'. 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 webpack 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/itracker/npm-debug.log

minhloc2011 avatar Nov 16 '16 16:11 minhloc2011

npm run prod

> @ prod /tmp/laravel-5-angular-2-example
> npm run webpack


> @ webpack /tmp/laravel-5-angular-2-example
> NODE_ENV=production $(npm bin)/webpack

fallbackLoader option has been deprecated - replace with "fallback"
loader option has been deprecated - replace with "use"
/tmp/laravel-5-angular-2-example/node_modules/schema-utils/dist/validateOptions.js:40
    throw new _ValidationError2.default(ajv.errors, name);
    ^

false

vrkansagara avatar Sep 24 '17 19:09 vrkansagara