javascript

java

python

c#

android

c++

node.js

php

html

jquery

ios

reactjs

css

.net

git

ruby-on-rails

sql

c

ruby

string

javascript-代理(如提琴手)可以与Node.js的ClientReques一起使用吗

是否可以将node.js设置为识别代理(例如Fiddler)并通过代理路由所有ClientRequest?

我在Windows上使用节点,并且想要调试http请求,就像在浏览器中使用Fiddler for JavaScript一样。

请注意,我不是在尝试创建代理,也不是在尝试接收服务器收到的代理请求。 我想通过代理路由http.request()发出的请求。 我想像在浏览器中执行请求一样,使用Fiddler来检查请求和响应。

trans by 2020-06-26T19:31:01Z

node.js-使用grunt服务器,如何将所有请求重定向到根url?

我正在构建我的第一个Angular.js应用程序,并且正在使用Yeoman。

Yeoman使用Grunt来允许您使用命令'grunt server'运行node.js连接服务器。

我正在html5模式下运行我的angular应用程序。 根据angular文档,这需要修改服务器以将所有请求重定向到应用程序的根目录(index.html),因为angular应用程序是单页ajax应用程序。

“使用[html5]模式需要在服务器端重写URL,基本上,您必须重写所有指向应用程序入口点的链接(例如index.html)”

这个问题中详细介绍了我要解决的问题。

如何修改我的grunt服务器,以将所有页面请求重定向到index.html页面?

trans by 2020-06-26T19:14:19Z

node.js-npm无法安装Express吗?

我目前安装了node.js版本0.8.8和npm 1.1.59。

每当我跑步时:

$ npm install -g express

我得到这个回报:

npm ERR! Error: EACCES, open '/Users/devinandrews/.npm/64a534c1-express.lock'
npm ERR!  { [Error: EACCES, open '/Users/devinandrews/.npm/64a534c1-express.lock']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/devinandrews/.npm/64a534c1-express.lock' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 12.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express"
npm ERR! cwd /Users/devinandrews
npm ERR! node -v v0.8.8
npm ERR! npm -v 1.1.59
npm ERR! path /Users/devinandrews/.npm/64a534c1-express.lock
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open '/Users/devinandrews/.npm/64a534c1-express.lock'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/devinandrews/npm-debug.log
npm ERR! not ok code 0

我正在拔头发,试图解决这个问题。

更新:

我跑了

$ npm -g ls

看看我的npm在全球安装了什么:

/usr/local/lib
├─┬ express@3.0.0rc4
│ ├── commander@0.6.1
│ ├─┬ connect@2.4.4
│ │ ├── bytes@0.1.0
│ │ ├── formidable@1.0.11
│ │ ├── pause@0.0.1
│ │ └── qs@0.4.2
│ ├── cookie@0.0.4
│ ├── crc@0.2.0
│ ├── debug@0.7.0
│ ├── fresh@0.1.0
│ ├── methods@0.0.1
│ ├── mkdirp@0.3.3
│ ├── range-parser@0.0.4
│ └─┬ send@0.0.4
│   └── mime@1.2.6
└─┬ npm@1.1.59
  ├── abbrev@1.0.3
  ├── ansi@0.1.2
  ├── archy@0.0.2
  ├── block-stream@0.0.6
  ├── chownr@0.0.1
  ├── couch-login@0.1.10
  ├── fstream@0.1.18
  ├─┬ fstream-npm@0.1.1
  │ └── fstream-ignore@0.0.5
  ├── glob@3.1.12
  ├── graceful-fs@1.1.10
  ├── inherits@1.0.0
  ├── ini@1.0.4
  ├─┬ init-package-json@0.0.5
  │ └── promzard@0.2.0
  ├── lockfile@0.2.1
  ├── lru-cache@2.0.1
  ├── minimatch@0.2.6
  ├── mkdirp@0.3.4
  ├── node-gyp@0.6.7
  ├── nopt@2.0.0
  ├── npm-registry-client@0.2.6
  ├─┬ npmconf@0.0.11
  │ └─┬ config-chain@1.1.1
  │   └── proto-list@1.2.2
  ├── npmlog@0.0.2
  ├── once@1.1.1
  ├── osenv@0.0.3
  ├─┬ read@1.0.4
  │ └── mute-stream@0.0.3
  ├── read-installed@0.0.2
  ├── read-package-json@0.1.4
  ├── request@2.9.203
  ├── retry@0.6.0
  ├── rimraf@2.0.2
  ├── semver@1.0.14
  ├── slide@1.1.3
  ├── tar@0.1.13
  ├── uid-number@0.0.3
  └── which@1.0.5

但是如果我跑:

$ npm ls

它返回空?

trans by 2020-06-26T05:21:10Z

javascript-点头的类似numpy的软件包

在我从事Python开发的那几年中,我总是惊讶于如果您设法重写numpy函数一次就可以在整个数组上工作的情况,那么事情会变得更快得多。 最近,我越来越多地切换到节点,并且正在寻找类似的东西。 到目前为止,我已经提出了一些建议,但都没有希望:

  • scikit-node,在python中运行scikit-learn,并与node连接。 我还没有尝试过,但是我不希望它能提供我想要的最先进的速度。
  • 有一些相当老而又新的javascript矩阵库(sylvester,gl-matrix等)。 除了不能确定它们在大于4x4的矩阵(在3D渲染中最有用)上能很好地工作之外,它们似乎是本机javascript(有些不确定(使用webGL加速))。 在浏览器上很棒,在节点上却不是。

据我所知,npms可以用C ++编写,所以我想知道为什么没有用于节点的类似numpy的库。 社区中需要这种功能的节点是否还没有足够的兴趣? 是否希望ES6功能(列表理解)将允许javascript编译器自动将本地JS代码向量化为C ++速度? 我可能还缺少其他东西吗?

编辑以回应近距离投票:注意,我并不是在问“什么是做xyz的最佳软件包”。 我只是想知道是否有技术上的原因,没有在节点上执行此操作的程序包,是出于社会原因,还是根本没有原因,而我只是错过了一个程序包。 也许要避免过多的自以为是的批评,我想知道:我有大约10000个矩阵,每个矩阵100 x 100。 将它们加在一起的最佳方式(*更正,合理快速)是什么?

编辑2经过更多的挖掘,结果发现我在搜索错误的东西。 Google用于“ node.js科学计算”,并提供了一些非常有趣的注释的链接:

  • [HTTPS://此时.stack Exchange.com/questions/1693/啊-faster-leaner-JavaScript-佛如-scientific-computing-what-features-手榴弹-i-可哦]
  • [HTTP://呜呜呜.Quora.com/can-node-就是-handle-numerical-computation-他和-same-蛙泳-that-languages-立刻-R-or-Julia-惨]
  • Javascript和科学处理?

基本上据我所了解,到目前为止,没有人打扰过。 另外,由于js TypedArrays中有一些主要遗漏(例如64位整数),仅通过使用NPM而不是侵入引擎本身可能很难添加良好的支持,这会破坏目的。 再说一次,我没有进一步研究最后的陈述。

trans by 2020-06-25T22:11:08Z

javascript-排序没有列'id'的表

我有一个表的以下顺序定义:

AcademyModule = sequelize.define('academy_module', {
        academy_id: DataTypes.INTEGER,
        module_id: DataTypes.INTEGER,
        module_module_type_id: DataTypes.INTEGER,
        sort_number: DataTypes.INTEGER,
        requirements_id: DataTypes.INTEGER
    }, {
        freezeTableName: true});

如您所见,此表中没有id列。 但是,当我尝试插入时,仍尝试以下sql:

 INSERT INTO `academy_module` (`id`,`academy_id`,`module_id`,`sort_number`) VALUES (DEFAULT,'3',5,1);

我该如何禁用明显具有的id功能?

trans by 2020-06-25T20:11:03Z

node.js-grunt错误:找不到模块“ load-grunt-tasks”

当我使用grunt命令时,它显示以下错误:

$ grunt
Loading "Gruntfile.js" tasks...ERROR
>> Error: Cannot find module 'load-grunt-tasks'
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.


Execution Time (2015-02-07 18:05:42 UTC)
loading tasks  339ms  ███████████████████████████████████████████████ 99%
Total 344ms

我已经尝试过-npm install,npm update命令。 如果有人可以帮助我,那就太好了。 谢谢!

添加Gruntfile.js的内容

'use strict';

var paths = {
  js: ['*.js', 'test/**/*.js', '!test/coverage/**', '!bower_components/**', 'packages/**/*.js', '!packages/**/node_modules/**', '!packages/contrib/**/*.js', '!packages/contrib/**/node_modules/**'],
  html: ['packages/**/public/**/views/**', 'packages/**/server/views/**'],
  css: ['!bower_components/**', 'packages/**/public/**/css/*.css', '!packages/contrib/**/public/**/css/*.css']
};

module.exports = function(grunt) {

  if (process.env.NODE_ENV !== 'production') {
    require('time-grunt')(grunt);
  }

  // Project Configuration
  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    assets: grunt.file.readJSON('config/assets.json'),
    clean: ['bower_components/build'],
    watch: {
      js: {
        files: paths.js,
        tasks: ['jshint'],
        options: {
          livereload: true
        }
      },
      html: {
        files: paths.html,
        options: {
          livereload: true,
          interval: 500
        }
      },
      css: {
        files: paths.css,
        tasks: ['csslint'],
        options: {
          livereload: true
        }
      }
    },
    jshint: {
      all: {
        src: paths.js,
        options: {
          jshintrc: true
        }
      }
    },
    uglify: {
      core: {
        options: {
          mangle: false
        },
        files: '<%= assets.core.js %>'
      }
    },
    csslint: {
      options: {
        csslintrc: '.csslintrc'
      },
      src: paths.css
    },
    cssmin: {
      core: {
        files: '<%= assets.core.css %>'
      }
    },
    nodemon: {
      dev: {
        script: 'server.js',
        options: {
          args: [],
          ignore: ['node_modules/**'],
          ext: 'js,html',
          nodeArgs: ['--debug'],
          delayTime: 1,
          cwd: __dirname
        }
      }
    },
    concurrent: {
      tasks: ['nodemon', 'watch'],
      options: {
        logConcurrentOutput: true
      }
    },
    mochaTest: {
      options: {
        reporter: 'spec',
        require: [
          'server.js',
          function() {
            require('meanio/lib/core_modules/module/util').preload(__dirname + '/packages/**/server', 'model');
          }
        ]
      },
      src: ['packages/**/server/tests/**/*.js']
    },
    env: {
      test: {
        NODE_ENV: 'test'
      }
    },
    karma: {
      unit: {
        configFile: 'karma.conf.js'
      }
    }
  });

  //Load NPM tasks
  require('load-grunt-tasks')(grunt);

  /**
   * Default Task
   */
  grunt.hook.push('clean', -9999);
  grunt.hook.push('concurrent', 9999);
  if (process.env.NODE_ENV === 'production') {
    grunt.hook.push('cssmin', 100);
    grunt.hook.push('uglify', 200);
  } else {
    grunt.hook.push('jshint', -200);
    grunt.hook.push('csslint', 100);
  }

  //Default task.
  grunt.registerTask('default', ['hook']);

  //Test task.
  grunt.registerTask('test', ['env:test', 'mochaTest', 'karma:unit']);

  // For Heroku users only.
  // Docs: https://github.com/linnovate/mean/wiki/Deploying-on-Heroku
  grunt.registerTask('heroku:production', ['cssmin', 'uglify']);
};
trans by 2020-06-25T16:18:15Z

异步-.n中的Node.js与Async / await

有人可以解释/重定向我吗,Node.js的异步模型(非阻塞线程)与任何其他语言(例如c#处理I / O的异步方法)之间有什么区别? 在我看来,两者都是相同的模型。 请提示。

trans by 2020-06-25T04:26:03Z

如何从命令行在Node.js上运行Jasmine测试

如何从命令行在Node.js上运行Jasmine测试? 我已经通过npm安装了jasmine-node并编写了一些测试。 我想在spec目录中运行测试并在终端中获取结果,这可能吗?

trans by 2020-06-25T00:26:51Z

使JavaScript字符串与SQL友好

是否有办法将JavaScript字符串传递给MySQL的NodeJS friendly? 我正在尝试将电子邮件地址传递给我的NodeJS服务器并查询到MySQL数据库。 在执行常规文本(例如用户名)时可以正常工作,但电子邮件地址却不能。 显然,使用转义不是正确的答案,因为这并不意味着要进行SQL插入。 我假设我需要一些在PHP函数mysql_real_escape_string()上的代码。

trans by 2020-06-24T19:39:05Z

node.js-Firebase的云函数-getaddrinfo ENOTFOUND

尝试使用PayPal-node-SDK向Paypal的API发出请求

exports.requestPayment = functions.https.onRequest((req, res) => {
    return new Promise(function (fullfilled, rejected) {
        paypal.payment.create(create_payment_json, {}, function (error, payment) {
            if (error) {
                rejected(error);
            } else {
                console.log("Create Payment Response");
                console.log(payment);
                res.status(200).send(JSON.stringify({
                    paymentID: payment.id
                })).end();
                fullfilled(payment);
            }
        });
     });
});

但我不断出错:

Error: getaddrinfo ENOTFOUND api.sandbox.paypal.com api.sandbox.paypal.com:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

我尝试过的事情:

  1. 向完全不同的主机发出请求,仍然是cors(req,res, ()=>{...})
  2. cors(req,res, ()=>{...})包装请求
  3. 在主机之前添加https://

问题是什么?

trans by 2020-06-24T09:09:05Z

javascript-缩小NodeJS中使用的代码是否有意义?

我想知道,由于Clojure Compiler和UglifyJS不仅针对大小优化代码,而且还针对性能进行优化(尽管我认为大小是主要的优先事项),如果我的node.js应用程序缩小了,它将运行得更快吗? 我知道这可能取决于应用程序,但我通常会问这个问题。

trans by 2020-06-24T06:33:43Z

Javascript-我们如何通过Npm与Meteor一起使用节点模块?

我们如何或如何通过nte与Meteor一起使用节点模块?

还是取决于包装API?

还是有建议的处方方法?

trans by 2020-06-23T22:02:54Z

geolocation-用于查找位置的最佳node.js模块?

我找到了几个node.js模块,用于使用ip地址查找有关客户端位置和网络的信息。

要求:

  1. 位置-国家,城市,州,纬度,经度等

  2. 网络-Internet服务提供商,Internet连接类型和Internet速度等。

  3. 数据准确性-最大可能性。

注意:寻找服务器端解决方案。

上面提到的模块使用maxmind数据。 而且我还阅读了有关maxmind数据准确性的信息。

我很少选择上面的node.js模块,我想知道有没有更好的node.js框架可用于查找满足我的要求的信息或任何其他可移植到node.js的语言插件。

任何想法将不胜感激。

trans by 2020-06-23T18:22:11Z

node.js-什么是req.isAuthenticated()护照J

在护照JS文档中,我认为护照认证功能没有很好地记录。

我想问一下,passport.isAuthenticated()id是做什么的?

trans by 2020-06-23T09:17:47Z

ubuntu-如何仅监听MongoDB上的localhost

MongoDB建议,处理安全性的简单方法是在受信任的环境中运行安全性,因为“在这种配置中,必须确保只有受信任的计算机才能访问数据库TCP端口。”

这样做的最佳方法是什么? mongodb是否有一种方法只能本地监听本地主机?

我正在使用Ubuntu 10.10

trans by 2020-06-23T03:47:10Z

node.js-具有SSL的npm http服务器

我正在使用npm包“ http-server”([https://www.npmjs.com/package/http-server)]来设置一个简单的Web服务器,但是我无法使用SSL。 我在package.json中的命令是

http-server -p 8000 -o -S

在我的根目录中(现在)带有cert.pem和key.pem。 “ -o”选项将浏览器打开到默认页面,但是该页面使用HTTP进行服务,甚至无法通过HTTPS访问。 我没有收到任何错误或警告。 我也尝试过添加“ -C”和“ -K”选项而没有运气。 有没有人在这个程序包上取得了成功?

trans by 2020-06-23T03:25:02Z

javascript-node.js在缺点上显示“ undefined”

最近,我在Windows 7计算机上安装了node.js。

在执行JavaScript时,随着表达式的成功执行,我收到一条未定义的消息。

怎么了 我还没有注意到任何其他副作用。

enter image description here

trans by 2020-06-22T14:13:08Z

javascript-使用ES6语法和动态路径导入模块

这个问题已经在这里有了答案:

  • node.js中的ES6变量导入名称? 9个答案

这有效:

import app from './../app.js';

但这不是:

import app from path.join(process.cwd(), 'app');

我越来越:

SyntaxError: /path/file.js: Unexpected token (5:16)
> 5 | import app from path.join(process.cwd(), 'app');
    |                 ^

有可能(和/或如何)使用“动态”路径? (不对路径进行硬编码或依赖相对路径)。

trans by 2020-06-21T22:58:22Z

node.js-无法使用节点npm安装任何软件包

我正在尝试通过npm安装一些节点软件包,但不会成功。我已经尝试安装/卸载/更新节点,但是似乎没有任何效果。

我正在使用ubuntu 12.04-这是我尝试安装软件包的方式:

npm install underscore

npm http GET http://registry.npmjs.org/underscore
npm http 404 http://registry.npmjs.org/underscore
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
npm ERR!     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
npm ERR!   </head>
npm ERR!   <body style="display: none;">
npm ERR!     <script type="text/javascript">
npm ERR! var reg = 'sedonewreg';
npm ERR! document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
npm ERR!     </script>
npm ERR!  </body>
npm ERR! </html>
npm ERR! 
npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
npm ERR!     at Request.self.callback (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:142:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:856:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/home/smanastirliu/local/lib/node_modules/npm/node_modules/request/index.js:808:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:895:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/smanastirliu/local/bin/node" "/home/smanastirliu/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! type unexpected_token
npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR!  { [Error: EACCES, open 'npm-debug.log'] errno: 3, code: 'EACCES', path: 'npm-debug.log' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/home/smanastirliu/local/bin/node" "/home/smanastirliu/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, open 'npm-debug.log'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0
smanastirliu@sviluppo69:~$ sudo npm install underscore
[sudo] password for smanastirliu: 
npm http GET http://registry.npmjs.org/underscore
npm http 404 http://registry.npmjs.org/underscore
npm ERR! registry error parsing json
npm ERR! SyntaxError: Unexpected token <
npm ERR! <html>
npm ERR!   <head>
npm ERR!     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
npm ERR!     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
npm ERR!   </head>
npm ERR!   <body style="display: none;">
npm ERR!     <script type="text/javascript">
npm ERR! var reg = 'sedonewreg';
npm ERR! document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
npm ERR!     </script>
npm ERR!  </body>
npm ERR! </html>
npm ERR! 
npm ERR!     at Object.parse (native)
npm ERR!     at RegClient.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
npm ERR!     at Request.self.callback (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:142:22)
npm ERR!     at Request.EventEmitter.emit (events.js:98:17)
npm ERR!     at Request.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:856:14)
npm ERR!     at Request.EventEmitter.emit (events.js:117:20)
npm ERR!     at IncomingMessage.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:808:12)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:895:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "underscore"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! type unexpected_token
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0

这是debug.log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   'underscore' ]
2 info using npm@1.2.18
3 info using node@v0.10.5
4 verbose node symlink /usr/local/bin/node
5 verbose read json /home/smanastirliu/package.json
6 verbose read json /home/smanastirliu/package.json
7 verbose cache add [ 'underscore', null ]
8 verbose cache add name=undefined spec="underscore" args=["underscore",null]
9 verbose parsed url { protocol: null,
9 verbose parsed url   slashes: null,
9 verbose parsed url   auth: null,
9 verbose parsed url   host: null,
9 verbose parsed url   port: null,
9 verbose parsed url   hostname: null,
9 verbose parsed url   hash: null,
9 verbose parsed url   search: null,
9 verbose parsed url   query: null,
9 verbose parsed url   pathname: 'underscore',
9 verbose parsed url   path: 'underscore',
9 verbose parsed url   href: 'underscore' }
10 silly lockFile 64bc6893-underscore underscore
11 verbose lock underscore /home/smanastirliu/.npm/64bc6893-underscore.lock
12 silly lockFile 64bc6893-underscore underscore
13 silly lockFile 64bc6893-underscore underscore
14 verbose addNamed [ 'underscore', '' ]
15 verbose addNamed [ null, '' ]
16 silly lockFile 7629b758-underscore underscore@
17 verbose lock underscore@ /home/smanastirliu/.npm/7629b758-underscore.lock
18 silly addNameRange { name: 'underscore', range: '', hasData: false }
19 verbose url raw underscore
20 verbose url resolving [ 'http://registry.npmjs.org/', './underscore' ]
21 verbose url resolved http://registry.npmjs.org/underscore
22 info trying registry request attempt 1 at 16:38:48
23 http GET http://registry.npmjs.org/underscore
24 http 404 http://registry.npmjs.org/underscore
25 verbose bad json <html>
25 verbose bad json   <head>
25 verbose bad json     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
25 verbose bad json     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
25 verbose bad json   </head>
25 verbose bad json   <body style="display: none;">
25 verbose bad json     <script type="text/javascript">
25 verbose bad json var reg = 'sedonewreg';
25 verbose bad json document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
25 verbose bad json     </script>
25 verbose bad json  </body>
25 verbose bad json </html>
26 error registry error parsing json
27 silly registry.get cb [ 404,
27 silly registry.get   { date: 'Mon, 29 Apr 2013 14:39:02 GMT',
27 silly registry.get     server: 'Apache',
27 silly registry.get     'content-length': '521',
27 silly registry.get     connection: 'close',
27 silly registry.get     'content-type': 'text/html; charset=UTF-8' } ]
28 silly lockFile 7629b758-underscore underscore@
29 silly lockFile 7629b758-underscore underscore@
30 error SyntaxError: Unexpected token <
30 error <html>
30 error   <head>
30 error     <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
30 error     <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
30 error   </head>
30 error   <body style="display: none;">
30 error     <script type="text/javascript">
30 error var reg = 'sedonewreg';
30 error document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
30 error     </script>
30 error  </body>
30 error </html>
30 error
30 error     at Object.parse (native)
30 error     at RegClient.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/npm-registry-client/lib/request.js:235:23)
30 error     at Request.self.callback (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:142:22)
30 error     at Request.EventEmitter.emit (events.js:98:17)
30 error     at Request.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:856:14)
30 error     at Request.EventEmitter.emit (events.js:117:20)
30 error     at IncomingMessage.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/node_modules/request/index.js:808:12)
30 error     at IncomingMessage.EventEmitter.emit (events.js:117:20)
30 error     at _stream_readable.js:895:16
30 error     at process._tickCallback (node.js:415:13)
31 error If you need help, you may report this log at:
31 error     <http://github.com/isaacs/npm/issues>
31 error or email it to:
31 error     <npm-@googlegroups.com>
32 error System Linux 3.5.0-27-generic
33 error command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "underscore"
34 error cwd /home/smanastirliu
35 error node -v v0.10.5
36 error npm -v 1.2.18
37 error type unexpected_token
38 verbose exit [ 1, true ]

业力的另一个例子:

sudo npm install karma
npm http GET http://registry.npmjs.org/karma
npm http 304 http://registry.npmjs.org/karma
npm http GET http://registry.npmjs.org/http-proxy
npm http GET http://registry.npmjs.org/glob
npm http GET http://registry.npmjs.org/minimatch
npm http GET http://registry.npmjs.org/optimist/0.3.5
npm http GET http://registry.npmjs.org/coffee-script
npm http GET http://registry.npmjs.org/rimraf
npm http GET http://registry.npmjs.org/xmlbuilder/0.4.2
npm http GET http://registry.npmjs.org/q
npm http GET http://registry.npmjs.org/LiveScript/1.0.1
npm http GET http://registry.npmjs.org/colors/0.6.0-1
npm http GET http://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http GET http://registry.npmjs.org/istanbul/0.1.22
npm http GET http://registry.npmjs.org/growly
npm http GET http://registry.npmjs.org/lodash
npm http GET http://registry.npmjs.org/pause/0.0.1
npm http GET http://registry.npmjs.org/mime
npm http GET http://registry.npmjs.org/log4js
npm http GET http://registry.npmjs.org/socket.io
npm http GET http://registry.npmjs.org/chokidar
npm http 304 http://registry.npmjs.org/minimatch
npm http 304 http://registry.npmjs.org/glob
npm http 304 http://registry.npmjs.org/optimist/0.3.5
npm http 304 http://registry.npmjs.org/coffee-script
npm http 304 http://registry.npmjs.org/xmlbuilder/0.4.2
npm http 304 http://registry.npmjs.org/rimraf
npm http 304 http://registry.npmjs.org/q
npm http 304 http://registry.npmjs.org/LiveScript/1.0.1
npm http 304 http://registry.npmjs.org/dateformat/1.0.2-1.2.3
npm http 304 http://registry.npmjs.org/growly
npm http 304 http://registry.npmjs.org/istanbul/0.1.22
npm http 304 http://registry.npmjs.org/colors/0.6.0-1
npm http 304 http://registry.npmjs.org/lodash
npm http 304 http://registry.npmjs.org/mime
npm http 304 http://registry.npmjs.org/pause/0.0.1
npm http 304 http://registry.npmjs.org/log4js
npm http 304 http://registry.npmjs.org/socket.io
npm http 304 http://registry.npmjs.org/chokidar
npm http 200 http://registry.npmjs.org/http-proxy
npm http GET http://registry.npmjs.org/http-proxy/-/http-proxy-0.10.2.tgz
npm http 200 http://registry.npmjs.org/http-proxy/-/http-proxy-0.10.2.tgz
npm http GET http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/lru-cache
npm http GET http://registry.npmjs.org/sigmund
npm http GET http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/base64id/0.1.0
npm http GET http://registry.npmjs.org/socket.io-client/0.9.11
npm http GET http://registry.npmjs.org/policyfile/0.0.4
npm http GET http://registry.npmjs.org/redis/0.7.3
npm http GET http://registry.npmjs.org/async/0.1.15
npm http GET http://registry.npmjs.org/dequeue/1.0.3
npm http GET http://registry.npmjs.org/prelude-ls
npm http GET http://registry.npmjs.org/semver
npm http GET http://registry.npmjs.org/readable-stream
npm http GET http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/escodegen
npm http GET http://registry.npmjs.org/handlebars
npm http GET http://registry.npmjs.org/mkdirp
npm http GET http://registry.npmjs.org/nopt
npm http GET http://registry.npmjs.org/fileset
npm http GET http://registry.npmjs.org/which
npm http GET http://registry.npmjs.org/async
npm http GET http://registry.npmjs.org/abbrev
npm http GET http://registry.npmjs.org/wordwrap
npm http 200 http://registry.npmjs.org/graceful-fs
npm http GET http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.0.tgz
npm http 200 http://registry.npmjs.org/graceful-fs
npm http 200 http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http GET http://registry.npmjs.org/pkginfo
npm http GET http://registry.npmjs.org/utile
npm http 200 http://registry.npmjs.org/base64id/0.1.0
npm http GET http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 http://registry.npmjs.org/wordwrap
npm http GET http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 http://registry.npmjs.org/lru-cache
npm http GET http://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 http://registry.npmjs.org/policyfile/0.0.4
npm http GET http://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 http://registry.npmjs.org/dequeue/1.0.3
npm http 200 http://registry.npmjs.org/async/0.1.15
npm http GET http://registry.npmjs.org/dequeue/-/dequeue-1.0.3.tgz
npm http GET http://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 200 http://registry.npmjs.org/socket.io-client/0.9.11
npm http GET http://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.11.tgz
npm http 200 http://registry.npmjs.org/redis/0.7.3
npm http GET http://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http 200 http://registry.npmjs.org/prelude-ls
npm http GET http://registry.npmjs.org/prelude-ls/-/prelude-ls-0.6.0.tgz
npm http 200 http://registry.npmjs.org/semver
npm http GET http://registry.npmjs.org/semver/-/semver-1.1.4.tgz
npm http 200 http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/esprima/-/esprima-0.9.9.tgz
npm http 200 http://registry.npmjs.org/mkdirp
npm http GET http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 http://registry.npmjs.org/handlebars
npm http GET http://registry.npmjs.org/handlebars/-/handlebars-1.0.10.tgz
npm http 200 http://registry.npmjs.org/fileset
npm http GET http://registry.npmjs.org/fileset/-/fileset-0.1.5.tgz
npm http 200 http://registry.npmjs.org/nopt
npm http GET http://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz
npm http 200 http://registry.npmjs.org/which
npm http GET http://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 http://registry.npmjs.org/escodegen
npm http GET http://registry.npmjs.org/escodegen/-/escodegen-0.0.22.tgz
npm http 200 http://registry.npmjs.org/abbrev
npm http GET http://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 http://registry.npmjs.org/wordwrap
npm http 200 http://registry.npmjs.org/graceful-fs/-/graceful-fs-1.2.0.tgz
npm http 200 http://registry.npmjs.org/inherits/-/inherits-1.0.0.tgz
npm http 200 http://registry.npmjs.org/pkginfo
npm http GET http://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz
npm http 200 http://registry.npmjs.org/base64id/-/base64id-0.1.0.tgz
npm http 200 http://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz
npm http 200 http://registry.npmjs.org/lru-cache/-/lru-cache-2.3.0.tgz
npm http 200 http://registry.npmjs.org/policyfile/-/policyfile-0.0.4.tgz
npm http 200 http://registry.npmjs.org/readable-stream
npm http GET http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
npm http 200 http://registry.npmjs.org/utile
npm http GET http://registry.npmjs.org/utile/-/utile-0.1.7.tgz
npm http 200 http://registry.npmjs.org/async/-/async-0.1.15.tgz
npm http 200 http://registry.npmjs.org/socket.io-client/-/socket.io-client-0.9.11.tgz
npm http 200 http://registry.npmjs.org/dequeue/-/dequeue-1.0.3.tgz
npm http 200 http://registry.npmjs.org/redis/-/redis-0.7.3.tgz
npm http 200 http://registry.npmjs.org/prelude-ls/-/prelude-ls-0.6.0.tgz
npm http 200 http://registry.npmjs.org/semver/-/semver-1.1.4.tgz
npm http 200 http://registry.npmjs.org/esprima/-/esprima-0.9.9.tgz
npm http 200 http://registry.npmjs.org/mkdirp/-/mkdirp-0.3.5.tgz
npm http 200 http://registry.npmjs.org/handlebars/-/handlebars-1.0.10.tgz
npm http 200 http://registry.npmjs.org/sigmund
npm http GET http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http 200 http://registry.npmjs.org/fileset/-/fileset-0.1.5.tgz
npm http 200 http://registry.npmjs.org/nopt/-/nopt-2.0.0.tgz
npm http 200 http://registry.npmjs.org/which/-/which-1.0.5.tgz
npm http 200 http://registry.npmjs.org/async
npm http 200 http://registry.npmjs.org/escodegen/-/escodegen-0.0.22.tgz
npm http GET http://registry.npmjs.org/async/-/async-0.1.22.tgz
npm http 200 http://registry.npmjs.org/abbrev/-/abbrev-1.0.4.tgz
npm http 200 http://registry.npmjs.org/pkginfo/-/pkginfo-0.2.3.tgz
npm http 200 http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.2.tgz
npm http 200 http://registry.npmjs.org/utile/-/utile-0.1.7.tgz
npm http 200 http://registry.npmjs.org/sigmund/-/sigmund-1.0.0.tgz
npm http GET http://registry.npmjs.org/deep-equal
npm http 200 http://registry.npmjs.org/async/-/async-0.1.22.tgz
npm http GET http://registry.npmjs.org/i
npm http GET http://registry.npmjs.org/ncp
npm http GET http://registry.npmjs.org/rimraf
npm http 200 http://registry.npmjs.org/deep-equal
npm http GET http://registry.npmjs.org/deep-equal/-/deep-equal-0.0.0.tgz
npm http 304 http://registry.npmjs.org/rimraf
npm http GET http://registry.npmjs.org/rimraf/-/rimraf-1.0.9.tgz
npm http 200 http://registry.npmjs.org/i
npm http GET http://registry.npmjs.org/i/-/i-0.3.1.tgz
npm http 200 http://registry.npmjs.org/deep-equal/-/deep-equal-0.0.0.tgz
npm http 200 http://registry.npmjs.org/rimraf/-/rimraf-1.0.9.tgz
npm http 200 http://registry.npmjs.org/ncp
npm http GET http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm http 200 http://registry.npmjs.org/i/-/i-0.3.1.tgz
npm http 404 http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm ERR! fetch failed http://registry.npmjs.org/ncp/-/ncp-0.2.7.tgz
npm ERR! Error: 404 Not Found
npm ERR!     at WriteStream.<anonymous> (/home/smanastirliu/Scaricati/node-v0.10.5-linux-x86/lib/node_modules/npm/lib/utils/fetch.js:57:12)
npm ERR!     at WriteStream.EventEmitter.emit (events.js:117:20)
npm ERR!     at fs.js:1596:14
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.5.0-27-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "karma"
npm ERR! cwd /home/smanastirliu
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm http GET http://registry.npmjs.org/uglify-js/1.2.5
npm http GET http://registry.npmjs.org/ws
npm http GET http://registry.npmjs.org/xmlhttprequest/1.4.2
npm http GET http://registry.npmjs.org/active-x-obfuscator/0.0.1
npm http 404 http://registry.npmjs.org/uglify-js/1.2.5
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/xmlhttprequest/1.4.2
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/active-x-obfuscator/0.0.1
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/ws
npm ERR! registry error parsing json
npm http GET http://registry.npmjs.org/source-map
npm http GET http://registry.npmjs.org/estraverse
npm http GET http://registry.npmjs.org/esprima
npm http GET http://registry.npmjs.org/uglify-js
npm http 404 http://registry.npmjs.org/esprima
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/source-map
npm ERR! registry error parsing json
npm WARN optional dep failed, continuing source-map@>= 0.1.2
npm http GET http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm http 404 http://registry.npmjs.org/estraverse
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/uglify-js
npm ERR! registry error parsing json
npm http 404 http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm ERR! fetch failed http://registry.npmjs.org/esprima/-/esprima-1.0.2.tgz
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/smanastirliu/npm-debug.log
npm ERR! not ok code 0

从浏览器调用程序包的URL,我得到一个奇怪的响应(任何URL的响应都相同):

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript" language="JavaScript" src="http://img.sedoparking.com/registrar/dopark.js"></script>
  </head>
  <body style="display: none;">
    <script type="text/javascript">
var reg = 'sedonewreg';
document.write( '<scr'+'ipt type="text/javascript" language="JavaScript"' + 'src="http://sedoparking.com/' + window.location.host + '/' + reg + '/park.js">' + '<\/scr' + 'ipt>' );
    </script>
 </body>
</html>

似乎是代理错误:我正在调查

trans by 2020-06-21T14:15:05Z

javascript-在Nod中Concat并缩小JS文件

NodeJS中是否有任何模块来串联和缩小JavaScript文件?

trans by 2020-06-21T13:28:07Z

上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 下一页 共174页