npm-scripts

Cannot find module autoprefixer in NPM scripts

╄→гoц情女王★ 提交于 2021-01-20 07:55:39
问题 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

NPM run build failed to compile - cannot get to build reactjs project

时光毁灭记忆、已成空白 提交于 2020-12-15 03:44:58
问题 Have spent last 3 hours trying to get my reactjs project to build... have removed package.json / node-modules, rebuild using npm install. Had to rebuild all my scss links for some reason, finally have development server running fine, but when i run NPM RUN BUILD i get the following error... > react-scripts build Creating an optimized production build... Failed to compile. Parse error on line 1: ^ Expecting "CALC", "LPAREN", "SUB", "NUMBER", "FUNCTION", "LENGTH", "ANGLE", "TIME", "FREQ", "RES"

Error When Running BrowserSync from Package.json Scripts

て烟熏妆下的殇ゞ 提交于 2020-08-19 06:48:28
问题 I have set up Browser Sync to work with nodemon and express. I am not using gulp or grunt, but rather running everything through npm scripts in my package.json file. Now, everything works, but I get an error when running my scripts and would like to know what the error is about and how I can fix it. First, here is my setup: { "scripts": { "dev": "npm run development", "dev:css": "postcss assets/css/style.css -o public/assets/css/style.css", "dev:sync": "browser-sync start --proxy 'localhost

How to continue running scripts defined in package.json in case one fails?

旧城冷巷雨未停 提交于 2020-07-22 05:15:41
问题 I have this in package.json file: { "name": "test demo", "version": "1.0.0", "description": "test demo scripts", "scripts": { "test:v1": "wdio src/resources/config/wdio.chrome.conf.js --spec test/Tests.spec.ts", "test:v2": "wdio src/resources/config/wdio.firefox.conf.js --spec test/Tests.spec.ts", "test": "npm run test:v1 && npm run test:v2" }, ... } When run this command: npm run test then if test:v1 fails, then test:v2 script is not executed at all. Is there a way to configure this so that

Set node environment variable to dynamic value in npm script

南笙酒味 提交于 2020-07-20 08:36:26
问题 I would like to set an environment variable dynamically in an npm script. I'm using cross-env as I'm developing on Windows and the server is Unix-based. I want to initialize an environment variable with the current date ( new Date() ) so I can access and render it in my create-react-app : This works (hard-coded string): "scripts": { "start": "cross-env-shell REACT_APP_BUILD_DATE=\"currentDate\" react-scripts-ts start", } Obviously, currentDate shouldn't be a string but the result of following

npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/react-is (over 30000ms)

 ̄綄美尐妖づ 提交于 2020-07-05 03:25:10
问题 When I want to create a react app I'm encountering the following error: npm ERR! Response timeout while trying to fetch https://registry.npmjs.org/react-is (over 30000ms) npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\info\AppData\Roaming\npm-cache\_logs\2020-04-23T02_54_45_865Z-debug.log Aborting installation. npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed. Deleting generated file... package.json Deleting app2/