Tag: npm

节点gyp错误TRACKER:错误TRK0005:无法find:“CL.exe”。 该系统找不到指定的文件

我想安装Visual Studio社区2015,Python v2.7.3安装Windows 10机器上的bcrypt,但我得到以下错误。 节点版本v4.2.1 node-gyp v3.0.3 npm install bcrypt C:\Users\ASMIN\Desktop\M2\app>npm install bcrypt npm WARN package.json eapp@1.0.0 No description npm WARN package.json eapp@1.0.0 No repository field. npm WARN package.json eapp@1.0.0 No README data > bcrypt@0.8.5 install C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt > node-gyp rebuild C:\Users\ASMIN\Desktop\M2\app\node_modules\bcrypt>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node -gyp.js" rebuild ) else (node rebuild ) Building […]

npm找不到package.json

我试图安装我已经下载的一些示例Express应用程序的依赖关系,但所有的应用程序抛出相同的错误: c:\node\stylus>npm install -d npm info it worked if it ends with ok npm info using npm@1.1.1 npm info using node@v0.6.11 npm ERR! Couldn't read dependencies. npm ERR! Error: ENOENT, no such file or directory 'c:\node\stylus\package.json' npm ERR! You may report this log at: npm ERR! <http://github.com/isaacs/npm/issues> npm ERR! or email it to: npm ERR! […]

用grunt自动化npm和bower安装

我有一个node / angular项目,使用npm作为后端依赖pipe理,而bower作为前端依赖pipe理。 我想使用一个咕task任务来执行两个安装命令。 我一直无法弄清楚如何去做。 我试图使用exec ,但实际上并没有安装任何东西。 module.exports = function(grunt) { grunt.registerTask('install', 'install the backend and frontend dependencies', function() { // adapted from http://www.dzone.com/snippets/execute-unix-command-nodejs var exec = require('child_process').exec, sys = require('sys'); function puts(error, stdout, stderr) { console.log(stdout); sys.puts(stdout) } // assuming this command is run from the root of the repo exec('bower install', {cwd: './frontend'}, […]

如何使用npm将TypeScript更新到最新版本?

目前,我的机器上安装了TypeScript 1.0.3.0版本。 我想更新到最新的一个,即2.0 。 如何与npm做到这一点?

什么是“npm -d install”中的“-d”?

我已经看到一些引用了-d参数运行npm文章。 例如, 这个问题是指做npm -d install coffee-script 。 还有一些其他页面也提到了这个语法,包括至less一个npm包的安装说明 。 但是我一直无法find这个-d参数的任何文档。 npm install的文档没有提及-d ,也没有提到npm FAQ ,也没有提到其他任何文档页面。 -d选项是否可以做任何事情? 如果是这样,什么?

为什么在npm中使用对等的依赖关系呢?

为什么例如一个Grunt插件将其依赖于grunt定义为“peer dependencies”? 为什么插件不能在grunt-plug / node_modules中使用Grunt作为自己的依赖项? 同行依赖关系在这里描述: https : //nodejs.org/en/blog/npm/peer-dependencies/ 但我真的不明白。 例 我现在正在使用AppGyver类固件,它使用Grunt任务将我的源文件构build到/ dist /文件夹中,以便在本地设备上提供。 我在npm和grunt方面很新,所以我想完全理解发生了什么。 到目前为止,我得到这个: [rootfolder] /package.json告诉npm它取决于grunt-steroids npm包进行开发: "devDependencies": { "grunt-steroids": "0.x" }, 好的。 在[rootfolder]中运行npm install检测依赖关系,并在[rootfolder] / node_modules / grunt-steroids中安装grunt-steroids 。 然后Npm读取[rootfolder] /node_modules/grunt-steroids/package.json,以便安装grunt-steroids自己的依赖项。 "devDependencies": { "grunt-contrib-nodeunit": "0.3.0", "grunt": "0.4.4" }, "dependencies": { "wrench": "1.5.4", "chalk": "0.3.0", "xml2js": "0.4.1", "lodash": "2.4.1" }, "peerDependencies": { "grunt": […]

如何更新npm

我正在尝试安装mean.io样板。 运行sudo npm install -g meanio@latest时失败。 在失败之前,它注意到它'想要'npm版本1.4.x,而我有1.2.18安装。 所以我尝试更新npm到最新的; 几种方法。 最后是… ubuntu@ip-xxx-xx-xx-xxx:~$ sudo npm install -g npm /usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js npm@1.4.7 /usr/local/lib/node_modules/npm ubuntu@ip-xxx-xx-xx-xxx:~$ npm –version 1.2.18 为什么当我刚刚更新到1.4.7时,它仍然显示版本1.2.18?

运行节点bin脚本时确定命令行工作目录

我正在创build一个节点命令行界面。 它是全局安装的,并使用bin文件来执行。 我打算在我正在处理的文件的根目录下打开一个命令窗口,然后运行命令,但是我一直无法确定当前的工作目录,因为process.cwd()正在返回节点包的目录。 我最初认为,因为代码是使用batch file作为包装来执行的(这就是bin文件如何在没有节点的情况下执行的),那么这是不可能的,但是咖啡脚本可以做到这一点。 我看了一下咖啡脚本源,但不能遵循它(没有足够的经验)。 要自己testing一下,用这个package.json文件创build一个包: { "name": "test-package", "version": "1.0.0", "bin": { "test-package": "./bin/test-package" }, "main": "/lib/test" } 这个testing包文件在bin中: #!/usr/bin/env node var path = require('path'); var fs = require('fs'); var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib'); require(lib + '/test'); 任何人都可以点亮这个。 然后尝试获取lib / test中的命令行目录。

什么是npm init中的“入口点”?

我有一个空的新项目,当我运行npm初始化我有一个问题的列表回答,例如: name: (karma) version: (1.0.0) description:my project description entry point: (index.js) 我真的很困惑那个说“入口点”,这应该是我的index.html文件或我的app.js或是别的东西?

我可以在coffeescript中编写npm包吗?

我已经使用咖啡一段时间了。 现在我需要写一个npm包,我可以写在coffeescript,或者我应该编译成javascript的coffeescript?