草庐IT

installation-path

全部标签

node.js - 运行 Grunt 时 path.resolve 的参数必须是字符串

我的Grunt文件:module.exports=function(grunt){grunt.initConfig({pkg:grunt.file.readJSON('package.json'),ts:{dev:{src:["src/background/*.ts"],out:["build/background.js"],}}});grunt.loadNpmTasks("grunt-ts");grunt.registerTask("default",["ts:dev"]);};(我正在使用grunt-ts。)系统信息Windows8.1NodeJSv0.10.24grunt-cli

node.js - 运行 Grunt 时 path.resolve 的参数必须是字符串

我的Grunt文件:module.exports=function(grunt){grunt.initConfig({pkg:grunt.file.readJSON('package.json'),ts:{dev:{src:["src/background/*.ts"],out:["build/background.js"],}}});grunt.loadNpmTasks("grunt-ts");grunt.registerTask("default",["ts:dev"]);};(我正在使用grunt-ts。)系统信息Windows8.1NodeJSv0.10.24grunt-cli

node.js - Azure "Web apps"服务 : auto-install npm modules from package. json

我在一个azure的“网络应用程序”容器中部署了一个node.js应用程序。我将“node_modules”文件夹添加到.gitignore并让azure从package.json安装模块。但是,大多数模块不会自动安装,我必须打开实例的命令行并使用“npminstall”手动安装它们。我正在使用Nodev0.12.0,这是我的package.json:{"main":"server.js","scripts":{"start":"nodeserver.js"},"devDependencies":{"body-parser":"^1.12.4","cors":"^2.6.1","exp

node.js - Azure "Web apps"服务 : auto-install npm modules from package. json

我在一个azure的“网络应用程序”容器中部署了一个node.js应用程序。我将“node_modules”文件夹添加到.gitignore并让azure从package.json安装模块。但是,大多数模块不会自动安装,我必须打开实例的命令行并使用“npminstall”手动安装它们。我正在使用Nodev0.12.0,这是我的package.json:{"main":"server.js","scripts":{"start":"nodeserver.js"},"devDependencies":{"body-parser":"^1.12.4","cors":"^2.6.1","exp

Node.js:以编程方式设置 NODE_PATH

我想在Node.js中动态加载文件,这带来了一个问题,即Node在调用模块的node_modules中查找,而不是在文件的node_modules中查找正在加载。我不想使用require()的原因是因为这些是插件,它们可以通过简单的连接被包含在主应用程序中。所以使用require()会破坏插件。它们必须直接加载到主应用程序上下文中,但它们也必须能够访问它们的本地node_modules。我使用vm.runInNewContext()来评估代码。但是如何将NODE_PATH传递给runInNewContext()? 最佳答案 要以编程

Node.js:以编程方式设置 NODE_PATH

我想在Node.js中动态加载文件,这带来了一个问题,即Node在调用模块的node_modules中查找,而不是在文件的node_modules中查找正在加载。我不想使用require()的原因是因为这些是插件,它们可以通过简单的连接被包含在主应用程序中。所以使用require()会破坏插件。它们必须直接加载到主应用程序上下文中,但它们也必须能够访问它们的本地node_modules。我使用vm.runInNewContext()来评估代码。但是如何将NODE_PATH传递给runInNewContext()? 最佳答案 要以编程

node.js - 为 Node 模块强制安装 yarn 而不是 npm install?

我想强制使用yarninstall而不是npminstall。我想在npminstall中引发错误。在package.json中应该做什么? 最佳答案 UPDATE:Alexander'sansweristhebettersolutionandusesthesametechniqueIdescribehere.Iamleavingmyanswerintactforposterity.Theoriginalpointofmyanswerwastoshowthatyoucanexecuteasmallnodescriptwhichsho

node.js - 为 Node 模块强制安装 yarn 而不是 npm install?

我想强制使用yarninstall而不是npminstall。我想在npminstall中引发错误。在package.json中应该做什么? 最佳答案 UPDATE:Alexander'sansweristhebettersolutionandusesthesametechniqueIdescribehere.Iamleavingmyanswerintactforposterity.Theoriginalpointofmyanswerwastoshowthatyoucanexecuteasmallnodescriptwhichsho

node.js - return process.dlopen(module, path._makeLong(filename));

从OpenCVNode运行示例时出现此错误returnprocess.dlopen(module,path._makeLong(filename));^Error:/home/sunny/face/build/opencv/v5.0.0/Release/node-v46-linux-x64/opencv.node:undefinedsymbol:_ZNK2cv9Algorithm5writeERNS_11FileStorageEatError(native)atObject.Module._extensions..node(module.js:460:18)atModule.load(

node.js - return process.dlopen(module, path._makeLong(filename));

从OpenCVNode运行示例时出现此错误returnprocess.dlopen(module,path._makeLong(filename));^Error:/home/sunny/face/build/opencv/v5.0.0/Release/node-v46-linux-x64/opencv.node:undefinedsymbol:_ZNK2cv9Algorithm5writeERNS_11FileStorageEatError(native)atObject.Module._extensions..node(module.js:460:18)atModule.load(