timoxley / npm-run Goto Github PK
View Code? Open in Web Editor NEWRun locally-installed node module executables.
License: MIT License
Run locally-installed node module executables.
License: MIT License
When running npmRun.exec(cmd, callback)
I got a TypeError: Cannot read property 'env' of undefined
(at augmentOptionsSync - index.js:73:34
).
Is it possible to remove that dep in favor of using the built in one?
I understand backwards compat issues, BUT let me tell you my story:
I am using the linter happiness (a fork of standard). I added it to the package.json
's of my company modules, about 100 of them. We are also using linklocal for development and a recursive link via bulk. Turns out that the npm install in all these directories takes like an hour. Here is the dependency tree that is leading here:
node_modules/happiness/node_modules/happiness-format/node_modules/esformatter/node_modules/npm-run/node_modules/spawn-sync
spawn-sync
is a c extension, so gets compiled for every npm install
that is run. I didnt spend the time to figure out how many times it is run, but I started it at like 9am and now it is 12 and it is still running :)
I had some time, so figured I would open an issue here.....
When I install bower locally and try to get it's version with npm-run bower --version I get the version of npm-run, not of bower. Same with grunt. I suspect that the --params are not passed to the binary correctly.
D:\Dev\webextension-test>npm-run --version
5.0.1
D:\Dev\webextension-test>npm-run web-ext --version
Error: spawn web-ext ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:379:16)
at process._tickCallback (internal/process/next_tick.js:114:19)
at Function.Module.runMain (module.js:705:11)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:660:3
D:\Dev\webextension-test>npm-run where web-ext
D:\Dev\webextension-test\node_modules\.bin\web-ext
D:\Dev\webextension-test\node_modules\.bin\web-ext.cmd
C:\Users\Owner\AppData\Roaming\npm\web-ext
C:\Users\Owner\AppData\Roaming\npm\web-ext.cmd
It works fine with v4.x.
This happens because eslint doesnt get installed in node_modules/bin
, but rather in node_modules/eslint/bin
. (but if I add a script in package.json, npm will find it).
Is this in the scope of the project? Would you accept a PR?
The code in npm/npm#4058, of which I believe most of is extracted from npm as it exists today, seems a lot larger. Is this module just as capable? If so, can we use it in npm itself? :)
My build is failing with security violation errors due to npm-run's dependency on syncExec, as reported in this issue and detailed in node security advisory 310. We should remove the polyfill, as child.execSync has been supported since 0.11.12, which has been end-of-life since 2016-10-31.
npm-run breaks due to "cross-spawn" not being installed. This dependency got removed in the last commit.
npm-run app-config build -e staging-f ./src/config.default.js
module.js:545
throw err;
^
Error: Cannot find module 'cross-spawn'
at Function.Module._resolveFilename (module.js:543:15)
at Function.Module._load (module.js:470:25)
at Module.require (module.js:593:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm-run/index.js:5:13)
at Module._compile (module.js:649:30)
at Object.Module._extensions..js (module.js:660:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:501:12)
at Function.Module._load (module.js:493:3)
Hi, it seems npm-run doesn't work on my windows. Basically it will return a not found: module-xyz
for every module I tried. But on bash on ubuntu for windows, same machine, it works (and in both cases, nothing is globally installed). Is it as intended ? Thank you
Is it possible to run a package from a sub-directory or a folder different from the root of the project? Now I get:
not found: PACKAGE_NAME
Thanks,
Marco.
http://stackoverflow.com/a/40313363/359072
And maybe put this in the readme so that future users will upvote.
Please adopt Node.js v1+ conventions and use the safer child_process.execSync()
function rather than legacy sync-exec
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.