Skip to content

Commit

Permalink
Merge pull request #4151 from laravel/fix
Browse files Browse the repository at this point in the history
Refactor npm scripts
  • Loading branch information
taylorotwell committed Feb 21, 2017
2 parents da9760f + 96f662a commit c1643bf
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
{
"private": true,
"scripts": {
"dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"hot": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"production": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
"dev": "node node_modules/webpack/bin/webpack.js --progress --hide-modules --config=$npm_package_config_webpack",
"watch": "npm run dev -- -w",
"watch-poll": "npm run dev -- -w --watch-poll",
"hot": "node node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=$npm_package_config_webpack",
"production": "npm run dev -- -p"
},
"config": {
"webpack": "node_modules/laravel-mix/setup/webpack.config.js"
},
"devDependencies": {
"axios": "^0.15.3",
Expand Down

5 comments on commit c1643bf

@vimalmistry
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riccai I got same error in windows 10 after updating my package.json file.

@Hendriksie
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riccai It works on windows but %npm_package_config_webpack% does not work on linux. I tried building it via github pipeline but got the following error:

Error: Cannot find module '/builds/group-name/repository-name/%npm_package_config_webpack%'

@Hendriksie
Copy link

@Hendriksie Hendriksie commented on c1643bf Feb 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riccai No problem! :) they reverted the changes so everything works again.

@Hendriksie
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@riccai it indeed would, but I think the Laravel team thought different :)

@OlivierVanEester
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's supposed to work again? A fresh Laravel installation still gives an error though:

_# npm run dev

@ dev c:\xampp\htdocs\grandi.com
node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

10% building modules 4/5 modules 1 active ....com\resources\assets\js\bootstrap.js(node:5524) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see webpack/loader-utils#56
parseQuery() will be replaced with getOptions() in the next major version of 95% emitting

ERROR Failed to compile with 1 errors 09:15:28

error in E:/Users/Liza/Desktop/websites/grandi.com/resources/assets/sass/app.scss

Module parse failed: E:\Users\Liza\Desktop\websites\grandi.com\resources\assets\sass\app.scss Unexpected character '@' (3:0)
You may need an appropriate loader to handle this file type.
|
| // Fonts
| @import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);
|
| // Variables

@ multi ./resources/assets/js/app.js ./resources/assets/sass/app.scss
Asset Size Chunks Chunk Names
public/js/app.js 1.16 MB 0 [emitted] [big] public/js/app
mix-manifest.json 32 bytes [emitted]

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\Liza\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "dev"
npm ERR! node v6.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @ dev: node node_modules/cross-env/bin/cross-env.js 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 2
npm ERR!
npm ERR! Failed at the @ dev script 'node node_modules/cross-env/bin/cross-env.js 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! node node_modules/cross-env/bin/cross-env.js 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:\Users\Liza\AppData\Roaming\npm-cache_logs\2017-02-24T08_15_28_798Z-debug.log_

Please sign in to comment.