I'm tring to use https://github.com/intljusticemission/react-big-calendar after forking
I can jspm install -dev github:pcompassion/react-big-calendar fine.
But it's lacking lib directory, I think jspm is not running "scripts" in package.json (Is it supposed to do?)
"scripts": {
"clean": "rimraf lib",
"clean:examples": "rimraf examples/static",
"less": "lessc --autoprefix=\"ie >= 10, last 2 versions\" src/less/styles.less ./lib/css/react-big-calendar.css",
"assets": "cpy src/less/* lib/less",
"build": "npm run clean && babel src --out-dir lib && npm run assets && npm run less",
"build:examples": "npm run clean:examples && webpack --config webpack/examples.config.es6.js",
"build:visual-test": "webpack --config webpack/visual-test.es6.js",
"examples": "npm run clean:examples && webpack-dev-server --inline --hot --config webpack/examples.config.es6.js",
"lint": "eslint src --ext .jsx --ext .js",
"storybook": "start-storybook -p 9002",
"test": "npm run lint",
"tdd": "karma start",
"release": "release"
},
So I should go to the folder and mannualy do npm install ?
Related
some of my functonality is breaking in prdo build with SSR but working fine with local SSR build.
I am not able to create the exact prod build command.
here is my dev build command
"ng": "ng",
"sonar": "sonar-scanner",
"start": "ng serve",
"start:ssl": "ng serve --ssl --disable-host-check",
"build": "node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"dev:ssr": "node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng run mystore:serve-ssr",
"serve:ssr": "node --max-http-header-size=16384 dist/mystore/server/main.js",
"serve:dev:ssr": "node --max-http-header-size=16384 dist/mystore-server/main.js",
"build:dev:ssr": "node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng build && node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng run mystore:server",
"build:ssr": "(cp server.prod.ts server.ts || copy server.prod.ts server.ts) && node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng build --prod && node --max-http-header-size=16384 ./node_modules/#angular/cli/bin/ng run mystore:server:production && mv dist/mystore-server/main.js dist/server.js || move dist\\mystore-server\\main.js dist\\server.js",
"prerender": "ng run mystore:prerender"
and the combined command I ran is
yarn build:dev:ssr & yarn serve:dev:ssr
I need how this replace Backend OCC url in the build
If you are using version 4.0, you may need to set the CX_BASE_URL as an environment variable when you build. There is an article here about the way the OCC url is handled between 3.0 and 4.0: https://chowdera.com/2021/08/20210807233507800o.html
I forked this ngx-extended-pdf-viewer and I'm trying to install it.
The npm scripts in its package.json looks like this
"scripts": {
"ng": "ng",
"start": "ng serve --deployUrl=/path/ --host 10.0.1.3 --disable-host-check",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"unix-package": "ng b ngx-extended-pdf-viewer && rm -r dist && ng-packagr -p projects/ngx-extended-pdf-viewer/ng-package.json",
"showcase": "npm run unix-package && rm -r ../extended-pdf-viewer-showcase/node_modules/ngx-extended-pdf-viewer && cp -R dist/ngx-extended-pdf-viewer ../extended-pdf-viewer-showcase/node_modules/ngx-extended-pdf-viewer",
"issue": "npm run unix-package && rm -r ../ngx-extended-pdf-viewer-issues/issue317-ng9/node_modules/ngx-extended-pdf-viewer && cp -R dist/ngx-extended-pdf-viewer ../ngx-extended-pdf-viewer-issues/issue317-ng9/node_modules/ngx-extended-pdf-viewer",
"win-package": "ng b ngx-extended-pdf-viewer && rmdir dist /S && ng-packagr -p projects/ngx-extended-pdf-viewer/ng-package.json",
"release": "npm run unix-package && cd dist/ngx-extended-pdf-viewer && npm publish && cd .. && cd .. && ./createTag.sh && node ./increase-version-number.js",
"cypress": "./node_modules/.bin/cypress open"
},
But it's not being installed,The error looks like this
I've search around the internet, and based from the answers is to add a npm script prepare.
So i added a prepare script:
"unix-package": "ng b ngx-extended-pdf-viewer && rm -r dist && ng-packagr -p projects/ngx-extended-pdf-viewer/ng-package.json",
"prepare": "npm run unix-package"
What it basically does is it packages the one under projectsngx-extended-pdf-viewer subfolder.
I've also added a empty .npmignore as advised here since the /dist folder is added in .gitignore.
Still doesn't work as expected. Hope to get help from you guys, i've been stuck on this problem for days.
Sorry for answering late - but here's a discussion covering and answering your question: https://github.com/stephanrauh/ngx-extended-pdf-viewer/discussions/910
The default package manager in my system is Yarn. I am trying to follow a course that uses NPM. Instead of shifting to NPM, I wanted to continue in Yarn but I got stuck in concurrently. How can I convert the following code for Yarn?
"start": "node backend/server",
"server": "nodemon backend/server",
"client": "npm start --prefix frontend",
"dev": "concurrently \"npm run server\" \"npm run client\"",
"data:import": "node backend/seeder",
"data:destroy": "node backend/seeder -d",
yarn version for above code will be:
"start": "node backend/server",
"server": "nodemon backend/server",
"client": "yarn --cwd frontend start",
"dev": "concurrently \"yarn server\" \"yarn client\"",
"data:import": "node backend/seeder",
"data:destroy": "node backend/seeder -d"
CWD - current working directory
I have created my react-app and only thereafter I added tailwind.
Currently this is my folder structure:
Package.json looks like this:
"scripts": {
"start": "postcss src/tailwind.css -o src/styles.css && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
I am unable to run my npm start script whenever I add postcss to the script and when I don't tailwind css is not applied to my project at all.
The error I am getting when I add postcss:
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phshopper#0.1.0 start: `postcss src/tailwind.css -o src/styles.css && react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phshopper#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Thanks
Can you please check the below code? Hope it will work for you.
#1 You need to add postcss src/tailwind.css -o src/styles.css in "build:css" and
#2 Keep the file build command npm run build:css in "build" like below.
"scripts": {
"start": "react-scripts start",
"build": "npm run build:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"build:css": "postcss src/tailwind.css -o src/styles.css",
}
I'm trying to use straight up npm as my build tool.
{
"name": "ang-starter",
"version": "1.0.0",
"description": "",
"main": "index.js",
"jshintConfig": {
"predef": ["angular"]
},
"scripts": {
"autoprefixer": "postcss -u autoprefixer -r src/assets/css/*",
"scss": "node-sass --output-style compressed -o src/assets/css src/assets/sass/main.scss",
"jshint": "jshint src/app/*.js",
"uglify": "uglifyjs src/app/*.js -o src/assets/js/app.min.js",
"serve": "browser-sync start --server --files 'src/assets/css/, src/assets/js/*.js, **/*.html, !node_modules/**/*.html'",
"watch:css": "onchange 'src/assets/sass/*.scss' -- npm run scss",
"watch:js": "onchange 'src/app/**/*.js' -- npm run jshint && npm run uglify",
"watch:all": "npm-run-all -p serve watch:css watch:js watch:images",
"postinstall": "npm run build:all && npm run watch:all"
},
"author": "",
"license": "ISC",
"devDependencies": {
"autoprefixer": "^6.3.7",
"browser-sync": "^2.13.0",
"jshint": "^2.9.2",
"node-sass": "^3.8.0",
"npm-run-all": "^2.3.0",
"onchange": "^2.5.0",
"postcss-cli": "^2.5.2",
"uglify-js": "^2.6.4"
}
}
My folder set up is like.
src
app
controllers
directives
filters
services
assets
css
images
js
sass
templates
index.html
package.json
My problem is with watch:js, I can run jshint and uglify separately and they work but if I run watch:js which uses && to run jshint and then uglify then the uglify doesn't work and it stops at jshint.
Try npm run watch:js instead of npm watch:js.
I had the same issue with npm in angular2. The build-script:
"build": "rimraf dist && webpack --config config/webpack.prod.js --progress --profile --bail"
wouldn't work - but both commands were running standalone. The run solved it for me.