草庐IT

npm-packages

全部标签

javascript - 如何让 npm 包 bin 使用实验模块选项运行?

从Nodev8.5.0开始,支持ES6风格的模块importxfrom'x'已通过使用选项--experimental-modules运行Node获得,如下:node--experimental-modulestest.mjs使用package.json中的bin键,您可以轻松创建cli工具npmcli,通过运行npm链接。不幸的是,当以这种方式运行时,调用node时没有可选的--experimental-modules标志。如何将bin模块与--experimental-modules一起使用?这是一个例子bin/healthcheck.mjsimport{connect}from'

node.js - npm 完全不起作用 : "Error: Cannot find module ' isarray'"

所以每次我尝试使用任何npm命令时都会遇到相同的错误:module.js:472throwerr;^Error:Cannotfindmodule'isarray'atFunction.Module._resolveFilename(module.js:470:15)atFunction.Module._load(module.js:418:25)atModule.require(module.js:498:17)atrequire(internal/module.js:20:19)atObject.(/usr/local/lib/node_modules/npm/node_module

node.js - npm 完全不起作用 : "Error: Cannot find module ' isarray'"

所以每次我尝试使用任何npm命令时都会遇到相同的错误:module.js:472throwerr;^Error:Cannotfindmodule'isarray'atFunction.Module._resolveFilename(module.js:470:15)atFunction.Module._load(module.js:418:25)atModule.require(module.js:498:17)atrequire(internal/module.js:20:19)atObject.(/usr/local/lib/node_modules/npm/node_module

node.js - 如何解决 npm install 中的 peerinvalid 错误?

我正在尝试按照步骤为PhysicsJS(https://github.com/wellcaffeinated/PhysicsJS#contributing)做出贡献,但在npminstall期间出现以下错误。npmERR!peerinvalidThepackagegrunt-contrib-jasminedoesnotsatisfyitssiblings'peerDependenciesrequirements!npmERR!peerinvalidPeergrunt-template-jasmine-requirejs@0.1.10wantsgrunt-contrib-jasmine@

node.js - 如何解决 npm install 中的 peerinvalid 错误?

我正在尝试按照步骤为PhysicsJS(https://github.com/wellcaffeinated/PhysicsJS#contributing)做出贡献,但在npminstall期间出现以下错误。npmERR!peerinvalidThepackagegrunt-contrib-jasminedoesnotsatisfyitssiblings'peerDependenciesrequirements!npmERR!peerinvalidPeergrunt-template-jasmine-requirejs@0.1.10wantsgrunt-contrib-jasmine@

node.js - Npm 对等依赖错误

我使用npminstall命令反复收到npmpeer依赖错误。这是我的package.json,我对react和webpack有未满足的对等依赖npmWARNreact-datepicker@0.25.0requiresapeerofreact@^0.14.0butnonewasinstalled.npmWARNbabel-loader@6.2.4requiresapeerofwebpack@1||^2.1.0-betabutnonewasinstalled.npmWARNdesktop-react@1.0.0Norepositoryfield.npmWARNdesktop-react

node.js - Npm 对等依赖错误

我使用npminstall命令反复收到npmpeer依赖错误。这是我的package.json,我对react和webpack有未满足的对等依赖npmWARNreact-datepicker@0.25.0requiresapeerofreact@^0.14.0butnonewasinstalled.npmWARNbabel-loader@6.2.4requiresapeerofwebpack@1||^2.1.0-betabutnonewasinstalled.npmWARNdesktop-react@1.0.0Norepositoryfield.npmWARNdesktop-react

node.js - Npm 模块安装 Visual Studio 错误

我在Windows8.1x64上,我有VisualStudio2013Ultimate。我以管理员身份运行控制台并执行npminstall-gkarma(与其他模块相同),但出现此错误:npmWARN可选dep失败,继续fsevents@0.2.0/ws@0.4.31installC:\ProgramFiles(x86)\nodejs\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws(node-gyprebuild2>builderror.log)||(exit

node.js - Npm 模块安装 Visual Studio 错误

我在Windows8.1x64上,我有VisualStudio2013Ultimate。我以管理员身份运行控制台并执行npminstall-gkarma(与其他模块相同),但出现此错误:npmWARN可选dep失败,继续fsevents@0.2.0/ws@0.4.31installC:\ProgramFiles(x86)\nodejs\node_modules\karma\node_modules\socket.io\node_modules\socket.io-client\node_modules\ws(node-gyprebuild2>builderror.log)||(exit

regex - 如何使用 express-validator npm 验证密码

我正在使用node编写restAPI,表达web模块。对于验证,我使用express-validatornpm。我想在密码字段上应用一些验证规则。如何使用express-validator实现它?我想申请密码的验证规则为:最少8个字符。至少有一个大写字母。至少一个小写字母。至少有一个特殊字符。我阅读了this链接表明有一个名为regex()的函数可用。所以我尝试了它,但根本不工作。我的做法:req.check("password","Passwordshouldbecombinationofoneuppercase,onelowercase,onespecialchar,onedigi