Comments (9)
You need to escape the double quotes:
"watch:dev": "parallelshell \"npm run build\" \"npm run serve\""
Running on:
Linux 4.10.0-20-generic #22-Ubuntu
node -v ~ v8.0.0
npm -v ~ 5.0.3
from parallelshell.
Thank You !
It is working like a charm
👯♂️
from parallelshell.
-
I think you need to change your git CRLF settings to Auto, depending on your OS. I am using OSX and I didn't run into that issue. Any pointers on how to reproduce it? I'm using SourceTree to do the Git work.
-
It is because it's not being used anywhere as far as I know. index.coffee calls it, but the tests don't do anything whether if I change it to cwd or cwd() so I didn't touch it. Do you have any screenshot to prove the issue so I can see?
Thanks!
from parallelshell.
In order to reproduce the issue you could:
-
npm i -D parallelshell
-
Write your script into the package.json, for instance:
"scripts": {
"build": "webpack -w",
"serve": "browser-sync start --server --startPath \"./built/static/\" --serveStatic \"./built/static/\" --index \"index.html\" --files \"./built/static/**/*.+(html|css|js)\" --port 3001",
"watch:dev": "parallelshell "npm run build" "npm run serve""
} -
Run your script:
npm run watch:dev
Here is the result:
[email protected] watch:dev /home/xxx/data/project/reactjs/mydev
parallelshell "npm run build" "npm run serve"
/usr/bin/env: ‘node\r’: No such file or directory
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] watch:dev: parallelshell "npm run build" "npm run serve"
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] watch:dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
from parallelshell.
npm publish from Windows handles CRLF incorrectly
from parallelshell.
Alright, I'm trying that, but I'm getting errors with that package.json format - actually, using double quotes inside a double-quoted string isn't valid JSON, I'm using this package.json and it throws an error, first of all:
package.json:
{
"name": "test1",
"version": "1.0.0",
"description": "Test1",
"main": "index.js",
"scripts": {
"build": "echo 'build'",
"serve": "echo 'serve'",
"watch:dev": "parallelshell "npm run build" "npm run serve""
},
"author": "",
"license": "ISC"
}
error:
npm ERR! file /Users/darkguy/_git/test1/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token 'p' at 9:35
npm ERR! "watch:dev": "parallelshell "npm run build" "npm run serve""
npm ERR! ^
npm ERR! File: /Users/darkguy/_git/test1/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! A complete log of this run can be found in:
Would you please be so kind to provide OS version, NPM and Node version so I can replicate? in OSX it's not working, I'm on Sierra 10.12.5, Node is 8.1.1 and NPM is 5.0.3.
Also, the publish was made under this same OSX machine, so that bug doesn't apply to me :P
from parallelshell.
Alright, you were right! I managed to reproduce it, I'll fix it right away, thanks for reporting :D
from parallelshell.
You are very welcome
from parallelshell.
Fixed & published! 👍
from parallelshell.
Related Issues (20)
- Why BrowserSync over Webpack-dev-server? HOT 1
- Issue with assigning variables HOT 5
- Feature request: Prefix output with (colored?) indicator of which process it came from HOT 1
- Suggestions for why parallelshell breaks node-notifier?
- Some output goes to the wrong terminal tab with two tabs open HOT 4
- Same argument passed to all shells? HOT 1
- Exit code is 0 when first command succeeds and second fails HOT 4
- fails on node8 HOT 3
- child_process throwing error ('"cwd" must be a string') HOT 24
- Allow 3.0 to be backwards compatible with < Node 8 HOT 6
- TypeError: "cwd" must be a string HOT 3
- New release? HOT 5
- Node 10.x version check fails HOT 9
- child_process throwing error ('"cwd" must be a string') HOT 2
- ERR_INVALID_ARG_TYPE error for Node v10.5.0 HOT 7
- The "options.cwd" property must be of type string. Received type function HOT 36
- Please do a release with the version check fork! HOT 7
- The "options.cwd" property must be of type string. Received type function HOT 1
- npm ERR! code ELIFECYCLE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parallelshell.