Questions tagged [npm-run]

This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts. run[-script] is used by the test, start, restart, and stop commands, but can be called directly, as well. When the scripts in the package are printed out, they're separated into lifecycle (test, start, restart) and directly-run scripts.

npm-run
Filter by
Sorted by
Tagged with
42 votes
4 answers
62k views

npm run dev --host network: not exposed

I want to expose my svelte app on LAN using the npm run dev --host command but it shows: > [email protected] dev > svelte-kit dev SvelteKit v1.0.0-next.295 local: http://localhost:3000 ...
blest's user avatar
  • 567
36 votes
5 answers
7k views

Vue router and Cordova (Vue.js)

EDIT So I just found out it has to do with the router being in history mode, if I remove 'mode': 'history', from router.js everything works again! Leaving here if others have the same problem, or if ...
Adam's user avatar
  • 3,182
31 votes
3 answers
20k views

How to check if npm script exists?

I am creating a bash script which runs through each of my projects and runs npm run test if the test script exists. I know that if I get into a project and run npm run it will give me the list of ...
theJuls's user avatar
  • 7,188
28 votes
2 answers
12k views

NPM run * doesn't do anything

I was running an Electron project, and everything worked just fine. But now when I run any of the scripts in my package.json (including npm start), it just escapes a line and doesn't do anything. My ...
Filip Troníček's user avatar
14 votes
3 answers
7k views

Node and NPM Running script and Ctrl-C triggers SIGINT twice

I've come across a problem on one of my Nodejs apps running with npm start (which just does node app.js). My app contains a sigint handler as follows: process.on('SIGINT', () => { db....
Jo Colina's user avatar
  • 1,884
11 votes
3 answers
20k views

react.js - running npm run build with custom paths

Running npm run build command on create-react-app project creates a build folder and some default paths inside all files like in map files: {"version":3,"sources":["../static/...
Itsik Mauyhas's user avatar
10 votes
2 answers
7k views

VSCode terminal process command failed to launch

I am trying out the Hello World sample extension. But when I run the extension from the 'Run Extension' task. It gives the following error: The terminal process command '/bin/zsh -c 'npm run watch'' ...
Labhansh Agrawal's user avatar
8 votes
3 answers
13k views

npm run scripts does not working

I have just initialized a new project with Node.js and trying making the scripts in package.json file to be working. For example I have the next package.json file: { "name": "my-app-name", "...
Raz Buchnik's user avatar
  • 8,091
8 votes
3 answers
7k views

How to fix react-native error after updating expo to 50.0

When I run npm run ios in terminal, I get the below error error: node_modules/expo-router/entry.js: [BABEL]: expo-router/babel is deprecated in favor of babel-preset-expo in SDK 50 I tried to ...
Elvin Shahsuvarli's user avatar
6 votes
1 answer
3k views

How to limit CPU usage of Docker build command?

My Dockerfile executes RUN npm run build command. When I execute docker build command on t2.micro EC2 instance, instance freezes and does not respond (I cannot even connect with ssh). When I monitor ...
Huseyin Aydin's user avatar
5 votes
1 answer
4k views

Is there a way to watch two Laravel Mix Webpack config files at the same time for any changes?

Using Laravel Mix, is it possible to watch two Webpack config files with one command so that changes to any of the underlying files instantly cause the necessary files to be compiled? Specifically, I ...
HartleySan's user avatar
  • 7,532
4 votes
1 answer
7k views

Npm run watch doesn't work with laravel : sh: cross-env: command not found

I want to execute "npm run watch" in my laravel project but it doesn't work. There is the error message @ watch /Applications/MAMP/htdocs/test-tech/laravel5 npm run development -- --watch @ ...
Cohchi's user avatar
  • 543
4 votes
2 answers
15k views

Unable to build react app using npm run build - Exit status 1

I have created a react app using create-react-app, and when I first tried to build it using npm run build, it was working fine. However, after a couple of days of developing when I try to run the same ...
user1959214's user avatar
3 votes
4 answers
6k views

package.json: how to test if node_modules exists

Inside package.json, is it possible to test if node_modules directory exists? My goal is to print a message if node_module does not exists, something like: node_module not existent: use npm run dist ...
caneta's user avatar
  • 1,802
3 votes
2 answers
2k views

ReferenceError: webpack_base_uri is not defined

ERROR: Html Webpack Plugin: Error: webpack://webpack/data:text/javascript,webpack_public_path_=webpack_base_uri=_htmlWebpackPl uginPublicPath;?:2 webpack_require.p = webpack_base_uri = ...
ymtx's user avatar
  • 41
3 votes
2 answers
439 views

Why does this fish while loop terminate after a single iteration?

This is a fish function used to upgrade JavaScript packages for a project. Strangely, it terminates after a single iteration with an exit status of 0. Why? function yarn-upgrade-all --description "...
Claudio's user avatar
  • 3,458
3 votes
1 answer
2k views

Using a package.json variable in npm script

I'm using npm run to build a javascript file through browserify. Before building, I would like it to create a directory in my build folder, named after the version listed in the package.json. Here is ...
LongInt's user avatar
  • 1,759
3 votes
3 answers
54k views

How to fix : cannot find Module error in while running the npm run build command

In my application, npm run build command throws a module not found error as below: npm WARN npm npm does not support Node.js v16.17.0 npm WARN npm You should probably upgrade to a newer version of ...
vijay s's user avatar
  • 307
3 votes
1 answer
574 views

How to remove Typescript assert when using npm run build?

What is the best way to remove Typescript asserts so that a production build created using npm run build is assert free? Thank you
Olivierwa's user avatar
  • 143
3 votes
0 answers
2k views

npm run dev won't auto refresh with latest changes

I have an vue.js application that won't auto refresh when I run 'npm run dev' - the application will only update when I run 'npm run build'. The application will start when I run npm run dev but it ...
user217nat's user avatar
3 votes
0 answers
4k views

webpack.optimize.UglifyJsPlugin has been removed

I am working on a udemy course project and upgraded on my packages and modules to their latest version, including webpack4. However, on running npm run-build, I am getting the following error in my ...
Jacques's user avatar
  • 205
3 votes
0 answers
771 views

npm run npm bin from within the same package

I'm working on extending open source raml2html library, which consumes raml contract to generate html docs. Key facts: the library has a binary placed in bin/raml2html file; th ebinary is stated in ...
ducin's user avatar
  • 26k
2 votes
1 answer
2k views

How to run 'imagemin' plugin with npm run script?

How could i use the imagemin plugin after having downloaded it with npm? Is there a way to run the plugin through 'npm run ' whenever i need to?
Dimitris Leon's user avatar
2 votes
1 answer
3k views

'react' - After run npm start it gives ./src/index.js Module not found: Can't resolve 'react' in 'C:\Users\...\src' error

In reactJs after run npm start it gives ./src/index.js Module not found: Can't resolve 'react' in 'C:\Users...\src' error. this is my package.js { "name": "client-app", "version": "...
Jayani Sumudini's user avatar
2 votes
2 answers
22k views

"Module build failed..." in Laravel Mix

I did not change anything in app.scss, but when I run npm run watch I get the following errors: error in ./resources/sass/app.scss ...
Taqi Vaheed's user avatar
2 votes
1 answer
2k views

TypeScript error in /home/Documents/node_modules/cheerio-select/lib/index.d.ts(1,15): [0] ',' expected. TS1005

Hello I am getting this error in terminal when i run npm run dev & npm run build in my terminal. [0] Failed to compile. [0] [0] /home/Documents/frontend/node_modules/cheerio-select/lib/index.d....
GCT's user avatar
  • 53
2 votes
1 answer
2k views

Is a different version of tsc used when using npm run?

I have VS Code and a Node.js project using Typescript. In my package.json script block there is an item: "build-ts": "tsc" If I run plain tsc on the integrated terminal command line, the compilation ...
Old Geezer's user avatar
  • 15.4k
2 votes
2 answers
2k views

Can't resolve 'react' when running "npm run"

My project has recently started complaining that it can't resolve react when I run the npm run dev script, which is: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --...
Ernest Melville's user avatar
2 votes
2 answers
2k views

How to Revert NPM Run Build With Laravel9

As the title says. Usually npm run dev is used for the local environment but I have run npm run build mistakenly in cmd and npm run build minify all files. Now I can't debug my front end.I also ...
Adnan Ali's user avatar
2 votes
2 answers
2k views

How do I fix 'The filename, directory name, or volume label syntax is incorrect' when trying to start environment

I have currently forked and cloned this repo and followed the instructions on the README.md. I have no problem installing my dependencies, but once I go to the next step of starting the WordPress ...
Leslie O's user avatar
  • 193
2 votes
3 answers
6k views

BUILD FAILED: can't install the app when i run npm run android

I am trying to build a mobile app using reactnative and testing on android emulator but when i run the app using npm run android it fails . I tried modifyiing the gradle.build file (upgrading sdk ...
Emna Gharsalli's user avatar
2 votes
0 answers
368 views

npm - error in main, module not found - new laravel (8) app

Complete Laravel newbie here but I've googled for the past hour with no luck. I've installed Laravel via composer (everything was working with the default set up) but I wanted to use bootstrap so I've ...
C Mills's user avatar
  • 21
2 votes
0 answers
370 views

How can i remove the errors while running the 'npm run build' command?

this is the error I am getting F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4>npm run build [email protected] build F:\Web Development\hong kong\Course1 bootstrap\week4Assignment4 ...
Jitesh's user avatar
  • 33
2 votes
0 answers
1k views

cross-env: Permission denied when deploy docker on container-optimized-os

First I deployed my laravel project on google container-optimized-os. And I have created the build by running: docker-compose up -d After it has finished to go into app container and I run: docker ...
Prototyp3's user avatar
2 votes
0 answers
807 views

VueJS-"npm run build" doesn not create index.html

I faced a problem in vue js when using "npm run build" command when try to deploy the app in to github. It does not create the index.html file in the dist folder. It only contains two files named as "...
Naynajith's user avatar
2 votes
1 answer
336 views

Run npm package installed on parent folder

I have folder structure of my project project-root |- sub-module1 |- sub-module2 and on project-root I have package.json with webpack in it so it gets installed on root of the project. Inside sub-...
Alchnemesis's user avatar
2 votes
0 answers
3k views

Unable to build react app using npm run build - Exit status 2

I have created a react app using create-react-app, and when I first tried to build it using npm run build, it was working fine. However, after a couple of days of developing when I try to run the same ...
Napat Krainara's user avatar
2 votes
2 answers
1k views

change port in react project with VITE

I'm working on an application integrated with Laravel 10 and React JS and I'm using Vite. I changed the port in package.json in the scripts part as follows ("dev": "vite --port=3000&...
abdelkarim el manssouri's user avatar
2 votes
1 answer
132 views

npm run Build:dev error when doing Advance UI Customization

I wanted to customize the UI elements in the publisher portal and followed this guide But I get the following error when running this in cmd; npm run build:dev ERROR in ./node_modules/@material-ui/...
Chess Sam's user avatar
1 vote
4 answers
3k views

Is it possible to create custom npm run commands for Laravel?

Laravel has the following built-in npm run commands (among others): npm run install npm run watch Is it possible to create custom npm run commands to run custom PHP scripts? For example, I want to ...
HartleySan's user avatar
  • 7,532
1 vote
8 answers
8k views

How to fix : Cannot find module 'webpack/bin/config-yargs'

I've running npm run dev command to run my react app. BUT then it pops up this Error: Cannot find module 'webpack/bin/config-yargs'. I've googled this error. Many people who solve this error tell me ...
Jessie's user avatar
  • 1,195
1 vote
1 answer
15k views

How do i build my angular application with `npm run build : production` instead of using `npm run build --production`?

Hi my angular application is building with the following command: npm run build --production and also it can be built with the following command: npm run build -- --c production But what I want is , ...
vijay s's user avatar
  • 307
1 vote
4 answers
4k views

Angular Build with Date and Build Number

I have an Angular (v12) project that gets updated regularly. Sometimes we do a build two or three times in a single day. The client wants to display the current version of the application in the ...
Lukho Mdingi's user avatar
1 vote
1 answer
1k views

npm script with just ts-node fails

I have a seemingly simple npm script that is failing but I cannot seem to figure out why. I have the following packages installed globally: +-- [email protected] +-- [email protected] +-- typeorm-...
eBehbahani's user avatar
  • 1,579
1 vote
1 answer
667 views

npm run dev error (the project has older versions of vue, php etc)

so im in a project of my company who i work for but im having a problem of doing npm run dev, doesnt work. i already tried npm install nuxt, npm install node so i dont know what to do :( node:...
vitoria's user avatar
  • 37
1 vote
1 answer
2k views

CircleCI is not running 'npm run' commands

I'm facing issues implementing a CI/CD pipeline with CircleCI. I'm not able to execute any 'npm run' commands in the pipeline whereas these commands run on my local system. I have built an Angular ...
siddube's user avatar
  • 31
1 vote
1 answer
870 views

Vue production build is failing, Where to look for error?

I am building a web app in Vue 2.6.11. I can run it on my local machine with npm run serve, but when I try to build it for production with npm run build I get the following error messages: internal/...
Aaron Reese's user avatar
1 vote
1 answer
517 views

What are the differences between the processes run by npm command:

Recently I made a simple API server using node.js+express. And the script below is a part of my package.json file I use to run with npm commands. "scripts": { ... "release": &...
Katherine_lee's user avatar
1 vote
1 answer
791 views

run postgraphile with npm

I'm working on a react app and using apollo and postgraphile for graphql. I currently have to have two terminal windows open, one running npm start for the react-dev server, and one running ...
Sdarb's user avatar
  • 183
1 vote
2 answers
9k views

"npm run build:css " can not work, while it is ok when I run the script self

I am doing a program, I meet some question when I use the npm script with Mac system; I have already install the node-sass globally, the package.json file is as follows: package.json it is not work ...
sunliying's user avatar