Code Monkey home page Code Monkey logo

Comments (12)

fengmk2 avatar fengmk2 commented on May 29, 2024

http://github.com/ant-design/ant-design 慢速 clone 中

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

@afc163 node_modules/.0.3.7@orchestrator/index.js:154 抛了异常,err 竟然是数字 1 ... 不知道什么情况。通过 ./node_modules/.bin/antd-tools run guard 运行可以重现。

} else if (err && !this.listeners('err').length) {
            // No one is listening for the error so speak louder
            console.log('err:', err, typeof err, JSON.stringify(err));
            throw err;
        }

image

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

antd-tools 依赖了 process.env.npm_config_argv 导致的。https://github.com/ant-design/antd-tools/blob/master/lib/utils/get-npm-args.js#L8https://github.com/ant-design/antd-tools/blob/master/lib/gulpfile.js#L210

我去看看 npm_config_argv 环境变量的定义。

from npminstall.

ziluo avatar ziluo commented on May 29, 2024

+1

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

process.env.npm_config_argv {"remain":[],"cooked":["run","prepublish"],"original":["run","prepublish"]}

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

使用的是这个模块 nopt https://github.com/npm/nopt/blob/10a750c9bb99c1950160353459e733ac2aa18cb6/lib/nopt.js#L43

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024
var conf = nopt(types, shorthands)
npm.argv = conf.argv.remain

定义太多,我还是简单模拟一下 nopt 好了。

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

npm 连 argv 都搞这么复杂。。。

from npminstall.

fhqdgv avatar fhqdgv commented on May 29, 2024

现在依然报错
npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "run" "dist" npm ERR! node v7.4.0 npm ERR! npm v4.0.5 npm ERR! code ELIFECYCLE npm ERR! [email protected] dist: antd-tools run dist`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] dist script 'antd-tools run dist'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the antd package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! antd-tools run dist
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs antd
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls antd
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! E:\test\ant-design\npm-debug.log
`

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

@fhqdgv cnpm -v 显示的是什么版本呢?怎样重现?

from npminstall.

fengmk2 avatar fengmk2 commented on May 29, 2024

@fhqdgv ant-design/ant-design#3143 (comment) 测试没问题的

from npminstall.

fhqdgv avatar fhqdgv commented on May 29, 2024

谢谢回复 应该不是cnpm问题,刚试了直接npm install也是同样的问题,可能是windows的原因
npm run dist后报错Error: spawn atool-build ENOENT
然后改了
`function runCmd(cmd, _args, fn) {
const args = _args || [];
const runner = require('child_process').spawn('cmd', ['/s', '/c', cmd, '-o', 'short'], args, {
// keep color
stdio: 'inherit',
env: getRunCmdEnv(),
});
// const runner = require('child_process').spawn(cmd, args, {
// // keep color
// stdio: 'inherit',
// env: getRunCmdEnv(),
// });

runner.on('close', (code) => {
if (fn) {
fn(code);
}
});
}`
再npm run dist才报的这个错npm ERR! Exit status 1

from npminstall.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.