npm-scripts

How to open multiple split terminals for each npm script?

随声附和 提交于 2021-02-11 13:54:13
问题 I have like 5 npm scripts and each of them need their own terminal because they runned in watch mode and write something in console. Here is the scripts: "server-build-dev": "cd ts/backend && npx tsc -w && npm run server-lint", "server-run-dev": "pm2 flush && pm2 start --only server --env development && pm2 logs", "server-lint": "cd ts/backend && esw -w --ext .ts", "client-build-dev": "cd ts/configs && npx webpack --config client.webpack.dev.js" I prefer split terminals to see everything that

How to make Angular watch multiple libraries for changes and recompile when needed

邮差的信 提交于 2021-02-11 12:40:44
问题 This question is much the same as Make angular app watch for libraries changes and update itself. But, that question was never successfully answered as applies to the use of multiple libraries. I also reviewed Angular library and live reload and surveyed the answers and links from both questions. My app is using two libraries: lib-1 and lib-2 . When those files are edited, they are ignored and the app does not recompile. To see changes, I have to restart the server which really slows things

How to make Angular watch multiple libraries for changes and recompile when needed

◇◆丶佛笑我妖孽 提交于 2021-02-11 12:39:13
问题 This question is much the same as Make angular app watch for libraries changes and update itself. But, that question was never successfully answered as applies to the use of multiple libraries. I also reviewed Angular library and live reload and surveyed the answers and links from both questions. My app is using two libraries: lib-1 and lib-2 . When those files are edited, they are ignored and the app does not recompile. To see changes, I have to restart the server which really slows things

npm-force-resolutions not working when installing a new package

两盒软妹~` 提交于 2021-02-08 13:15:28
问题 I'm using the scripts section of the package.json to force resolutions: "preinstall": "npx npm-force-resolutions" in the resolutions section, I have entered graceful-fs with a specified version: "resolutions": { "graceful-fs": "^4.2.4", }, When i run npm i everything is installed correctly, the set versions are taken in to account. But later on when I install an additional module, e.g. npm i random-package , my set versions are being thrown away and I endup with graceful-fs@1.2.3 and other

npm prepare script not building folder in node modules

爷,独闯天下 提交于 2021-02-07 10:17:31
问题 I am trying to use npm's prepare script to run a build step when npm installing from a different project. The script does run during the npm install however, it doesn't build out the dist folder inside node modules. Refer to this article for more details http://jim-nielsen.com/blog/2018/installing-and-building-an-npm-package-from-github/ 回答1: I also had the same problem. My prepare script wasn't creating the build directory in the node_modules folder when installing as dependency. Finally I

npm prepare script not building folder in node modules

孤者浪人 提交于 2021-02-07 10:16:35
问题 I am trying to use npm's prepare script to run a build step when npm installing from a different project. The script does run during the npm install however, it doesn't build out the dist folder inside node modules. Refer to this article for more details http://jim-nielsen.com/blog/2018/installing-and-building-an-npm-package-from-github/ 回答1: I also had the same problem. My prepare script wasn't creating the build directory in the node_modules folder when installing as dependency. Finally I

Is there a way to get the name of the npm script passed to the command specified by that script?

半腔热情 提交于 2021-02-05 09:14:07
问题 With npm or yarn, is it possible for the script specified by an npm script to know the name of the npm script itself? For example: "scripts": { "foo": "echo Original command: $0", "bar": "echo Original command: $0" } I'd like the result of those two scripts to be something like: Original command: yarn run foo Original command: yarn run bar But all I actually get is: Original command: /bin/sh . And in case it makes a difference, it's just the name of the script I need, not the yarn run part,

How to copy a whole directory recursively with an npm script on Windows 10 Powershell?

和自甴很熟 提交于 2021-01-28 12:02:15
问题 How to copy a whole directory recursively with an npm script on Windows 10 Powershell? Right now I have the following tree: test ├───1 │ package.json │ └───2 └───src │ asd.txt │ └───asd asd - Copy (2).txt asd - Copy.txt asd.txt What I want is a script that when run in dir 1 it goes to dir 2 and copies the whole dir src recursively from there to dir 1 . So in the end I would have a similar src in 1 as there is in 2 . When I cd to the directory 1 and run npm run build:ui which is defined in

How can I get rid of the `Node “13.0.0-nightly20190802452b393c1f”` so that I can be able to create a react app using the `create-react-app` tool?

谁说我不能喝 提交于 2021-01-28 07:13:06
问题 I'm trying to create a react app using npx's create-react-app command in ubuntu 18.04 terminal. I have Node v12.8.0 installed. When I run the command npx create-react-app . in the directory of my app, I expect the react app boilerplate folders and files to be generated since I have the latest version of Node v12.8.0 and npm v6.10.2 in my machine.Instead, I get the below output... npx: installed 91 in 5.725s Creating a new React app in /home/<my-PC>/Documents/todo-app. warning You are using

Cannot find module autoprefixer in NPM scripts

久未见 提交于 2021-01-20 07:55:57
问题 Under windows 10 and npm version 6.9.0, I cannot get the following script to work: "build:css": "postcss --use autoprefixer -b 'last 2 versions' < ./static/css/main.css" I'm always getting same error in the Windows console as follows: Plugin Error: Cannot find module 'autoprefixer' I've tried changing the syntax to the following one with no results: "build:css": "postcss --use autoprefixer -b \"last 10 versions\" ./static/css/main.css -o ./static/css/main-prefixed.css" Can anyone tell me