Now It doesn't run on my ubuntu machine. When I run the npm start command it says missing script start. Is there any method to run the downloaded project?
In your package.json file, check scripts property:
"scripts": {
"clean": "rimraf build/*",
"copy-assets": "ts-node src/tools/copyAssets",
"tsc": " tsc",
"build": "npm-run-all clean tsc copy-assets",
"dev": "nodemon --watch src -e ts,ejs,css --exec npm run dev:start",
"dev:start": "npm-run-all build start",
},
Looks like start script does not exist. Instead run the appropriate one from the scripts section.
Related
Every time I add a new class in the className of a react component, i need to go to the terminal and type npm run build-css in order for the classes to take effect.
What npm run build-css does is "build-css": "npx tailwindcss build -o src/styles/main.css",.
Is there a way to not have to run the above command on every UI change I do? I have used tailwind css in nextjs by following the official guide and it updates on its own whenever I do a change in the UI.
My scripts:
"scripts": {
"prod": "cross-env NODE_ENV=production webpack --mode production --config webpack.build.config.js && electron --noDevServer . ",
"start": "cross-env NODE_ENV=development webpack serve --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development && craco start",
"build": "cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production && craco build",
"watch-css": "npx tailwindcss build -i src/styles/index.css -o src/styles/main.css --watch",
"build-css": "npx tailwindcss build -o src/styles/main.css",
"package-m1": "electron-forge package --arch=arm64 --platform=darwin",
"package-intel": "electron-forge package --arch=x64 --platform=darwin",
"package": "npm run package-m1 && npm run package-intel",
"postpackage": "electron-packager ./ --out=./builds"
},
You should be able to combine this command into your normal run command, I'm not sure if you're using a framework or not but if you go into you package.json and look at your normal run/start command you can edit that to include the tailwind build. Depending on if you are using a unix or windows environment it will be slightly different. For react it would look like this(I don't remember syntax for nextjs)
"start": "npx tailwindcss build -o src/styles/main.css && node scripts/start.js"
The above would be for windows and the below for unix
"start": "npx tailwindcss build -o src/styles/main.css & node scripts/start.js"
I have installed the react-clear-cache package and in the docs it says that I need to add a new script to my package.json.
This is my package.json scripts:
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"prebuild": "npm run generate-build-meta",
"generate-build-meta": "./node_modules/react-clear-cache/bin/cli.js"
},
According to the docs I need to run npm run generate-build-meta but everytime I try, node tells me that it wasnt able to find "./node_modules/react-clear-cache/bin/cli.js"
What I should do to correctly run this cli.js?
By the way, I have the react-clear-cache in my node_modules and I can see the cli.js
This is the message I receive:
It is pretty much saying that '.' is not recognized as an internal command.
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"prebuild": "npm run generate-build-meta",
"generate-build-meta": "react-clear-cache"
},
Accessing node_modules binaries by path is unnecessary in package.json scripts. Within the package.json, you can proceed as though node_modules/**/bin/ is in your $PATH.
I am trying to start a react and node based application that works fine in mac systems, but when I am trying to start in windows, it's throwing an error.
The command to start is - yarn start:all
The script entries in package.json file are -
"scripts": {
"docs": "jsdoc2md src/*.js src/**/*.js > API.md",
"build:dev": "better-npm-run build:dev",
"build:production": "better-npm-run build:production",
"style": "eslint --fix --ext .js,.jsx src config",
"unit": "cross-env LOG_LEVEL=warn jest",
"coverage": "cross-env LOG_LEVEL=warn helix test --coverage",
"test": "yarn style && yarn coverage",
"start:inspect": "nodemon --inspect .",
"eject": "helix eject",
"start": "better-npm-run start:stage",
"start:ordersPresentationStage": "micro_cancellations_path=http://localhost:3001/cancellations/micro yarn --cwd ../orders-presentation-helix startStage",
"start:laptopProxyServer": "node tools/laptopDevProxyServer.js",
"start:all": "concurrently --kill-others -n proxy,orders,cancellation \"yarn start:laptopProxyServer\" \"yarn start:ordersPresentationStage\" \"yarn start\"",
"start:production": "yarn run build:production && cross-env ASSET_PATH=/cancellationspres/assets/ NODE_ENV=production node .",
"build-stats:development": "yarn start -- --analyze",
"build-stats:production": "yarn build -- --analyze",
"generate:component": "helix generate:component",
"clean": "rimraf ./build",
"std-version": "standard-version"
},
The error that I am getting is -
'micro_cancellations_path' is not recognized as an internal or external command, operable program or batch file.
I assume the start:ordersPresentationStage part of scripts is unable to execute because the line cannot be processed in windows system, but I am not able to find an alternative statement for the same. Please help!
I have my package.json as below. I would like to trigger a bamboo build through npm scripts which should trigger npm install and then it should trigger npm run bamboo.
I am trying to make the build fail if my testcases fail.kindly help in how to configure in bamboo to achieve the same
"scripts": {
"dev": "webpack",
"prod": "webpack -p",
"start": "webpack-dev-server --open",
"build": "npm run clean-dist && npm run dev && npm run start",
"pbuild": "npm run clean-dist && npm run prod && npm run start",
"clean-dist": "rimraf ./dist && mkdir dist",
"lint": "esw webpack.config.js app",
"lint:watch": "npm run lint -- --watch",
"test": "karma start --reporters html",
"pro": "protractor protractor.config.js",
"bamboo": "npm run clean-dist && npm run dev && npm run test"
}
In bamboo plan configuration:
1. Add new task
2. Select 'npm' type
3. Select Node.js executable - version of your nodeJs, installed on the server
4. Command: run test
This will run your 'test' script from package json
I couldn't find a sample document that demonstrates how to setup vscode for angular2 via typescript debugging without npm Script Runner.
Quickstart is a generic solution that would work even IDE is not VSCODE
So simply I'm asking for a documentation/repository about how to convert all commands below into VSCODE tasks without spending hours to figure out correct syntax/structure.
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
},
In-case you think this is a duplicate of another question such as Debug & Run Angular2 Typescript with Visual Studio Code? please make sure that provided answer is not using npm start.
e.g. accepted answer of that question uses it at step 5