Package.json missing script: stg - npm

Using codeship to deploy to aws. Got error like
npm ERR! missing script: stg
custom script
git clone https://${GITHUB_KEY}#github.com/me/myproject.git
ls
cd myproject
composer install --no-interaction --prefer-dist
nvm install 6.9.4
npm install sync-exec
npm install
npm rebuild node-sass
npm run stg
partial webpack
"scripts": {
"clean": "rimraf public/dist",
"watch": "webpack --config webpack.dev.config.js --watch --progress",
"dev": "webpack --config webpack.dev.config.js --progress",
"prod": "cross-env npm run clean && NODE_ENV=production webpack --config webpack.config.js --progress --profile --colors",
"stg": "cross-env npm run clean && NODE_ENV=stage webpack --config webpack.dev.config.js --progress --profile --colors",
"lint": "eslint ./app/**/**.js"
},
codeship error
npm run stgnpm ERR! Linux 4.15.0-1009-aws
npm ERR! argv "/home/rof/.nvm/versions/node/v6.9.4/bin/node" "/home/rof/.nvm/versions/node/v6.9.4/bin/npm" "run" "stg"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! missing script: stg
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! /home/rof/src/github.com/myaccountname/myproject/myproject/npm-debug.log

Related

Laravel 7 on homestead with npm error "cross-env"

[Update]
Vue complier 2.6.12 triggers this error when I try in npm clean-install
tarball tarball data for vue-template-compiler#2.6.12 (sha512-KIq15bxxxxxx) seems to be
corrupted. Trying one more time.
I run npm cache clean --force then change both versions to 2.6.11 but Vue changes its version automatically to 2.6.12 and can't get it working
I have been trying to install VueJs to a current Laravel 7 project. I reach this command
npm install && npm run dev
I got a warning of mismatch between Vue and the template compiler so I changed the package.json to make them both the same version
"vue": "^2.6.12",
"vue-template-compiler": "^2.6.12"
And changed their version in package-lock.json too.
then I deleted node_modules folder then run npm install again. I got multiple errors so I kept running the same command multiple times till it finished installing. Now I'm trying to run npm run dev but I get this error
errno ENOENT
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! spawn ENOENT
How to fix it and make the application work with VueJs?
Have you tried prefixing cross-env calls in package.json with npx cross-env?
For example,
// OLD
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
// NEW
"development": "npx cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",

npm install command not working in npm script

Given a package.json that includes the following scripts:
"scripts": {
"dev": "npm install && webpack-dev-server --hot --progress --colors",
"build": "npm install && webpack --env.prod --progress --colors",
"start": "npm run dev"
}
Running npm start gives me many errors of the sort
`npm WARN tar ENOENT: no such file or directory, open 'C:\repos\my-project\node_modules\.staging\core-js-ea8988d1\client\shim.js'
followed by
npm ERR! code 1
npm ERR! Command failed: git submodule update -q --init --recursive
npm ERR! C:/Users/JohnDoe/AppData/Local/Programs/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found
However, if instead I just run npm install directly, the npm installation of packages succeeds with no errors, and then I can run npm start thereafter with no issues. Why is this? There seems to be some kind of issue with including npm install in an npm script if the packages are not yet installed. I also tried setting start to "npm install" but running npm start gave me the same errors in that case.

laravel 6 npm run dev failed

I recently start learning laravel and already did 2 project, but suddenly the NPM RUN DEV failed when i create new laravel 6 project.
I can still run my old project and also already tried rm -rf node_modules && npm cache clean --force && npm install.
here is the error in terms :
# dev C:\xampp\htdocs\SimplePOS
npm run development
# development C:\xampp\htdocs\SimplePOS
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
C:\Users\Eric\AppData\Roaming\npm\node_modules\cross-env\src\index.js:23
)
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (C:\Users\Eric\AppData\Roaming\npm\node_modules\cross-env\src\bin\cross-env.js:3:18)
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "development"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
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\SimplePOS\npm-debug.log
npm ERR! Windows_NT 10.0.17134
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
npm ERR! node v6.11.1
npm ERR! npm v3.10.10
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\SimplePOS\npm-debug.log
can someone help this newbie fix this problem?
I used package.json of another system.
{
"private": true,
"scripts": {
"dev": "npm run development",
"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 run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"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"
},
"devDependencies": {
"axios": "^0.19",
"bootstrap": "^4.0.0",
"cross-env": "^5.1",
"jquery": "^3.2",
"laravel-mix": "^4.0.7",
"lodash": "^4.17.13",
"popper.js": "^1.12",
"resolve-url-loader": "^2.3.1",
"sass": "^1.20.1",
"sass-loader": "7.*",
"vue": "^2.5.17",
"vue-template-compiler": "^2.6.10"
}
}

Eslint and start webpack

I would like to run eslint before webpack start.
I installed parallel and npm-run-all packages but didn't help.
When I type: npm run dev I get:
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! myproject-ui#1.0.0
eslint: eslint src/ npm ERR! Exit status 1 npm ERR! npm ERR! Failed
at the myproject-ui#1.0.0 eslint script. npm ERR! This is probably not
a problem with npm. There is likely additional logging output above.
My package.json:
"scripts": {
"start": "node ./node_modules/webpack-dev-server/bin/webpack-dev-server.js",
"test": "mocha --compilers js:babel-core/register ./tests/**/*.js",
"test:watch": "npm run test -- --watch",
"code:coverage": "nyc npm run test",
"eslint": "eslint src/",
"dev": "npm-run-all --parallel start eslint"
},
Any idea how to run eslint and webpack parallel?;)
Greetings
It's not elegant solution but works fine
"lint": "eslint src || exit 0",
"dev": "npm-run-all --parallel lint start"
Because link returns exit 1 err so it makes them work parallel even though ;).

In Vue-CLI run dev, fail.

In the vue-cli, I want to npm run dev, but get the bellow error:
$ npm run dev
> vuejs-playlist#1.0.0 dev /Users/den/Desktop/Test/vue/vuejs-playlist
> cross-env NODE_ENV=development webpack-dev-server --open --hot
sh: cross-env: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! vuejs-playlist#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 vuejs-playlist#1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/den/.npm/_logs/2018-02-02T11_54_11_067Z-debug.log
Try as follows for #vue/cli
npm run serve
In your traceback:
Local package.json exists, but node_modules missing, did you mean to install?
You should in your project root directory install the dependencies:
npm install
Or use its logogram npm i
As both answers before stated your build failed due needing to first:
npm install
Once that is complete, check your package.json file.
In there will have the default options for npm run followed by your build script option.
Example:
{
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build"
}
}
Resulting in your npm run serve is the same as vue-cli-service serve
Reference: Vue Docs