Tag: npm

“永远”的node.js安装,但不再工作

一两天前,我用npm安装了“ forever ”包,并且永远CLI按预期工作。 然而,今天当我试图永远使用(使用命令forever start app.js ),它给了以下错误消息(格式化我的): forever : The term 'forever' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 我已经尝试过永久重新安装,npm / node.js和Visual Studio Code(我当前的IDE /文本编辑器),但是这些都不起作用。 也没有重新启动我的电脑。 […]

将节点6.10.3安装为NPM依赖项

处理使用无服务器框架部署到AWS Lambda的项目 ,我希望运行AWS Lambda上可用节点的相同版本 – 即节点6.10.3。 添加到“引擎”没有任何作用,所以我也把它添加到“依赖” ,但安装该依赖总是失败: > node@6.10.3 preinstall /Users/ssterling3/Documents/2017/IIT/Apps/Student Dashboard/mobile-dashboard/node_modules/node > node installArchSpecificPackage npm ERR! code ETARGET npm ERR! notarget No matching version found for node-darwin-x64@6.10.3 npm ERR! notarget In most cases you or one of your dependencies are requesting npm ERR! notarget a package version that doesn't exist. npm ERR! A […]

如何使用r-script从节点中获取R脚本的输出数据

我正在尝试使用r-script从node.js执行R脚本,因为它看起来很简单。 通过文档示例: example.js var out = R("ex-sync.R") .data("hello world", 20) .callSync(); console.log(out); 前sync.R needs(magrittr) set.seed(512) do.call(rep, input) %>% strsplit(NULL) %>% sapply(sample) %>% apply(2, paste, collapse = "") 我应该是R脚本的最后一行的variables总是空的,我不知道为什么会发生这种情况。

安装包后,Webpack无法编译错误

我正在使用Angular 4的一些样板代码,并且遇到问题。 它工作正常,直到我从npm下载另一个包。 我得到以下错误,命令ng服务不再起作用。 该项目已经安装了jquery,所以错误对我来说没有意义。 没有webpack.config.js文件,所以我添加了下面的代码。 任何帮助,将不胜感激。 webpack.config.js文件 var webpack = require('webpack'); var config = { plugins: [ new webpack.ProvidePlugin({ $: "jquery", jQuery: "jquery" }) ] }; module.exports = config; 错误 警告in ./~/jsdom/lib/jsdom/utils.js 216:21-40严重依赖关系:依赖关系的请求是一个expression式 警告在./~/jsdom/lib/jsdom/living/xmlhttprequest.js 20:23-30关键依赖关系:require函数的使用方式不能静态提取依赖关系 警告in ./~/ajv/lib/async.js 96:20-33严重依赖:依赖的请求是一个expression式 警告in ./~/ajv/lib/async.js 119:15-28严重依赖关系:依赖关系的请求是一个expression式 警告在./~/ajv/lib/compile/index.js 13:21-34关键依赖关系:依赖关系的请求是一个expression式 ERROR in ./~/jquery/lib/node-jquery.js Module not found:错误:无法parsing'E:\ WebstormProjects \ innovation-node-server-2.0 \ node_modules […]

从C#.NET标准类库调用节点

我试图为MJML框架构build一个C#包装器库。 当“手工”运行时,mjml框架往往会通过一个powershell或bash脚本来使用,它会执行一些我无法理解的随机内容,但显然会影响对node node_modules/mjml/bin/mjml 。 我有什么办法在本地安装节点,并从C#类库中运行命令? 我是否必须使用例如System.Diagnostics.Process的bash调用? 我通过networking浏览,但是我发现所有的东西都是edgejs ,它似乎既是矫枉过正,也不是真的被devise来做到这一点。

Node.js发行w / Engine.io

我在处理服务器端节点脚本时遇到问题。 我有一个VPS和运行节点app.js在我的网站1的其他虚拟文件夹中工作得很好。 但是,当我在我的网站2虚拟文件夹中运行节点app.js它说 /home/website2/node_modules/engine.io/node_modules/uws/uws.js:3 const http = require('http'); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at Server.init (/home/website2/node_modules/engine.io/lib/server.js:115:16) at new Server (/home/website2/node_modules/engine.io/lib/server.js:65:8) at Function.attach (/home/website2/node_modules/engine.io/lib/engine.io.js:123:16) at Server.initEngine (/home/website2/node_modules/socket.io/lib/index.js:274:21) 首先,我会的 cd /home/website2 那我就去 node app.js 这显示了上面的错误,但是当我 cd […]

不能创build目录tns_modules

我在运行演示应用程序im Nativescript时遇到问题。 我运行: tns run ios 并有错误: 无法在设备上应用更改:DEVICE_ID。 错误是:处理node_modules失败。 错误:cp:无法创build目录“/ workspace / demo / platforms / ios / demo / app / tns_modules”:没有这样的文件或目录。 我究竟做错了什么?

JIMP在nodejs中无效的文件签名

我使用JIMP将我的图像转换为灰度,并降低其质量。但是对于2%的情况下,它正在损坏我的形象,并在控制台中抛出一个错误 – “错误:无效的文件签名在Parser._parseSignature(C:\ Users \ Akshay \ Desktop \ darwin \ node_modules \ pngjs \ lib \ parser.js:50:18)“如果问题代码如下: var ext=path.extname(dest); if(ext!='.jpg'){ dest=replaceExt(dest, '.jpg'); } console.log(path.extname(dest)); var file = fs.createWriteStream(dest); ////console.log(url) if(url.indexOf('https')!=-1){ //console.log("https") var request = https.get(url, function(response) { response.pipe(file); file.on('finish', function() { Jimp.read(dest).then(function (lennaa) { lennaa.resize(256, 256) // resize .quality(90) // set JPEG quality .greyscale() […]

npm:缺lessnode_modules中的传递依赖关系

我有两个本地npm项目, A和B 比方说, A依赖于react并将其列为package.json文件中的依赖项。 我使用npm link使A可用于B B依赖于A并react 。 我使用npm link A来使用npm link A的本地版本。 但是,据我所知, A已经依赖于react ,我不包括在我的package.json文件的react 。 当我打电话给npm install我希望npm在node_modules文件夹中包含传递依赖关系。 但是,我无法findreact ,只要不在B的package.json文件中包含传递依赖关系,我也不能在B的代码中使用它。 当我包含react等其他模块,我也得到像fbjs或encodingparsing到我的node_modules文件夹传递依赖node_modules 。 那么,错误在哪里? /为什么A的依赖关系不包含在B的node_modules文件夹中?

如何具有环境特定的NPM加载path?

我有一些node.js库作为模块打包,并通过npm install –save进行npm install –save 。 这是一个debugging的痛苦,因为我必须发布一个模块,然后更新使用较新的版本。 我看到这个SO问题: 如何指定本地模块作为npm包依赖关系 ,我可以指定我的依赖关系作为path,这是好得多。 有没有一种方法可以创build一个debugging环境,使用path进行模拟加载,然后使用npm模块的发布环境? 在这种情况下,'release'是由命令pkg -t win index.js创build的。 即 我想开发模块的相对path 我想“切换”使用npm中的模块,而无需在任何地方更改string。 然后。 如果以上是可能的,我想不要将模块文件导入到node_modules,但运行它(我试图利用VS代码debugging)