question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Works from CLI, but not from npm scripts

See original GitHub issue

I’ve tried this with a couple commands, and I’m not sure what the issue is, but using npm run to run a script with copyfiles in it doesn’t work. The same command as ./node_modules/.bin/copyfiles works fine

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
FireController1847commented, Jul 30, 2018

WOOOW. I spent three hours having this issue with 5 different modules, and it’s all because I wasn’t using quotes. I cannot believe how hard it was to find this fix. Thanks guys, seriously.

3reactions
goerpcommented, Feb 24, 2016

Using escaped double quotes in stead of single quotes works for me (windows 7, npm@3.7.1 node@v5.6.0): npm command:

npm run assets

where ‘assets’ is: copyfiles -u 1 "./src/*/+(.eot|.ttf|.woff)" dist

Now to test if it still works on Mac

Read more comments on GitHub >

github_iconTop Results From Across the Web

Istanbul working on command line, but not as npm script
I'm afraid that's not working for me: istanbul is installed locally so I can't use "istanbul" command; I've tried changing mocha bin ...
Read more >
node.js - npx <package> runs on command line but not in ...
1 Answer 1 · After integrating any package without command try "npx run".It will install the missing packages in node modules. · Make...
Read more >
npm-run-script
Description. This runs an arbitrary command from a package's "scripts" object. If no "command" is provided, it will list the available scripts.
Read more >
How to run more than one command as part of a npm script
A common scenario: as part of your npm start script, you need to have more than one command run (like webpack --config webpack.server.js...
Read more >
Sending command-line arguments to an npm script
If you need something really custom, though, “npm scripts” are the way to go. You might have used this for your “build” or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found